Giter Site home page Giter Site logo

ota-meshi / eslint-plugin-json-schema-validator Goto Github PK

View Code? Open in Web Editor NEW
63.0 3.0 4.0 1.74 MB

ESLint plugin that validates data using JSON Schema Validator.

Home Page: https://ota-meshi.github.io/eslint-plugin-json-schema-validator/

License: MIT License

JavaScript 3.93% TypeScript 96.07%
json-schema eslint-plugin eslintplugin eslint json jsonc json5 yaml toml validation

eslint-plugin-json-schema-validator's Introduction

Introduction

eslint-plugin-json-schema-validator is ESLint plugin that validates data using JSON Schema Validator.

NPM license NPM version NPM downloads NPM downloads NPM downloads NPM downloads NPM downloads Build Status

📛 Features

This ESLint plugin validates JSON, JSONC, JSON5, YAML, TOML, JavaScript and Vue Custom Blocks with JSON Schema.

You can check on the Online DEMO that uses JavaScript, JSON, YAML and TOML.

📖 Documentation

See documents.

💿 Installation

npm install --save-dev eslint eslint-plugin-jsonc eslint-plugin-json-schema-validator

Requirements

  • ESLint v6.0.0 and above
  • Node.js v14.18.x, v16.x and above

📖 Usage

Configuration

New Config (eslint.config.js)

Use eslint.config.js file to configure rules. See also: https://eslint.org/docs/latest/use/configure/configuration-files-new.

Example eslint.config.js:

import eslintPluginJsonSchemaValidator from 'eslint-plugin-json-schema-validator';
export default [
  // add more generic rule sets here, such as:
  // js.configs.recommended,
  ...eslintPluginJsonSchemaValidator.configs['flat/recommended'],
  {
    rules: {
      // override/add rules settings here, such as:
      // 'json-schema-validator/no-invalid': 'warn'
    }
  }
];

This plugin provides configs:

  • *.configs['flat/base'] ... Configuration to enable correct JSON, YAML and TOML parsing.
  • *.configs['flat/recommended'] ... Above, plus rule to validate with JSON Schema.

Legacy Config (.eslintrc)

Use .eslintrc.* file to configure rules. See also: https://eslint.org/docs/latest/use/configure/.

Example .eslintrc.js:

module.exports = {
  extends: [
    // add more generic rulesets here, such as:
    // 'eslint:recommended',
    'plugin:json-schema-validator/recommended'
  ],
  rules: {
    // override/add rules settings here, such as:
    // 'json-schema-validator/no-invalid': 'error'
  }
}

This plugin provides configs:

  • plugin:json-schema-validator/base ... Configuration to enable correct JSON, YAML and TOML parsing.
  • plugin:json-schema-validator/recommended ... Above, plus rule to validate with JSON Schema.

Running ESLint from the command line

If you want to run eslint from the command line, make sure you include the .json, .jsonc, .json5, .yaml, .yml and .toml extension using the --ext option or a glob pattern, because ESLint targets only .js files by default.

Examples:

eslint --ext .js,.json,.jsonc,.json5,.yaml,.yml,.toml src
eslint "src/**/*.{js,json,jsonc,json5,yaml,yml,toml}"

💻 Editor Integrations

Visual Studio Code

Use the dbaeumer.vscode-eslint extension that Microsoft provides officially.

You have to configure the eslint.validate option of the extension to check .json, .jsonc, .json5, .yaml, .yml and .toml files, because the extension targets only *.js or *.jsx files by default.

Example .vscode/settings.json:

{
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        "json",
        "jsonc",
        "json5",
        "yaml",
        "toml"
    ]
}

✅ Rules

The rules with the following star ⭐ are included in the configs.

Rules

Rule ID Description Fixable RECOMMENDED
json-schema-validator/no-invalid validate object with JSON Schema.

⚡ Advanced Usage

Settings

Use .eslintrc.* file to configure settings. See also: https://eslint.org/docs/user-guide/configuring/configuration-files#adding-shared-settings.

Example .eslintrc.js:

module.exports = {
  settings: {
    "json-schema-validator": {
      http: {
        getModulePath: "",
        requestOptions: {},
      }
    }
  }
}

Example of http

Example of using the request module for HTTP requests.

./path/to/request-get.js:

const request = require("request")

/**
 * GET Method using request module.
 */
module.exports = function get(url, options) {
    return new Promise((resolve, reject) => {
        request.get(url, options, (error, _res, body) => {
            if (error) {
                reject(error)
                return
            }
            resolve(body)
        })
    })
}

.eslintrc.js:

module.exports = {
  settings: {
    "json-schema-validator": {
      http: {
        getModulePath: require.resolve("./path/to/request-get.js"),
        requestOptions: {
          // Example of proxy settings.
          proxy: "http://my.proxy.com:8080/"
        },
      }
    }
  }
}

🍻 Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

Development Tools

  • npm test runs tests and measures coverage.
  • npm run update runs in order to update readme and recommended configuration.

Working With Rules

This plugin uses jsonc-eslint-parser, yaml-eslint-parser and toml-eslint-parser for the parser.

👫 Related Packages

🔒 License

See the LICENSE file for license rights and limitations (MIT).

eslint-plugin-json-schema-validator's People

Contributors

dhaxor avatar github-actions[bot] avatar jounqin avatar logicer16 avatar marcroemmelt avatar nspire909 avatar ota-meshi avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eslint-plugin-json-schema-validator's Issues

Consider reporting only the most specific error(s)?

It would be great if only the most specific error(s) were reported. For example, given this GitHub Actions workflow file:

name: Push
on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
      - runn: npm install # <-- whoopsie, a typo!
      - rn: npm run build # <-- uhoh, another one!
      - run: npm run test
      - run: npm run lint

You get the following errors:

   4:3  error  "jobs.test" must have required property 'uses'               json-schema-validator/no-invalid
   4:3  error  "jobs.test" must match exactly one schema in oneOf           json-schema-validator/no-invalid
   5:5  error  Unexpected property "jobs.test["runs-on"]"                   json-schema-validator/no-invalid
   6:5  error  Unexpected property "jobs.test.steps"                        json-schema-validator/no-invalid
  12:9  error  "jobs.test.steps[2]" must have required property 'uses'      json-schema-validator/no-invalid
  12:9  error  "jobs.test.steps[2]" must have required property 'run'       json-schema-validator/no-invalid
  12:9  error  "jobs.test.steps[2]" must match exactly one schema in oneOf  json-schema-validator/no-invalid
  12:9  error  Unexpected property "jobs.test.steps[2].runn"                json-schema-validator/no-invalid
  13:9  error  "jobs.test.steps[3]" must have required property 'uses'      json-schema-validator/no-invalid
  13:9  error  "jobs.test.steps[3]" must have required property 'run'       json-schema-validator/no-invalid
  13:9  error  "jobs.test.steps[3]" must match exactly one schema in oneOf  json-schema-validator/no-invalid
  13:9  error  Unexpected property "jobs.test.steps[3].rn"                  json-schema-validator/no-invalid

This can cause some confusion/churn; ideally just the Unexpected property "jobs.test.steps[2].runn" and Unexpected property "jobs.test.steps[3].rn" would get reported. I tried setting ajv's allErrors: false to reduce the noise, but that's worse (although the run error provides a good hint for the first typo, the second typo is not reported):

   4:3  error  "jobs.test" must have required property 'uses'               json-schema-validator/no-invalid
   4:3  error  "jobs.test" must match exactly one schema in oneOf           json-schema-validator/no-invalid
  12:9  error  "jobs.test.steps[2]" must have required property 'uses'      json-schema-validator/no-invalid
  12:9  error  "jobs.test.steps[2]" must have required property 'run'       json-schema-validator/no-invalid
  12:9  error  "jobs.test.steps[2]" must match exactly one schema in oneOf  json-schema-validator/no-invalid

I haven't dug into the code too deeply, but it seems like it should be possible to just keep the most specific errors (i.e. for each error we encounter, discard any errors from ancestor nodes). Perhaps this could be opt-in to start, WDYT? I'd be happy to create a PR if you're interested in this feature.

Cannot confirgure schema

Hi, thanks for the plugin! But I cannot configure a local schema into the plugin... There are no examples of how to specify your schema?

What is wrong with the eslintrc.js below?

module.exports = {
  extends: [
    "plugin:json-schema-validator/recommended",
  ],
  plugins: ["json-schema-validator"],
  rules: {
    'json-schema-validator/no-invalid': [
      'error',
      {
        schemas: [
          {
            "fileMatch": ["config.jsonc"],
            "schema": {
              "$schema": "http://json-schema.org/draft-07/schema#",
              "definitions": {   
                  "Item": {
                      "enum": [
                          "DEFAULT",
                          "ENTERTAINMENT",
                          "HELP",
                          "HOME",
                          "KIDS",
                          "LATINO",
                          "MOVIES",
                          "MY_ACCOUNT",
                          "NEWS",
                          "SPORTS",
                          "WWE"
                      ],
                      "type": "string"
               },
              "properties": {
                  "item": {
                      "$ref": "#/definitions/Item"
                  },
              },
              "type": "object"
            },
          }
        ],
        "useSchemastoreCatalog": false
      }
    ]
  },
};

You should add "parserOptions.extraFileExtensions" to your config

if I give the following command in terminal
eslint ./test.json --fix

I get:

0:0 error Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: test.json.
The extension for the file (.json) is non-standard. You should add "parserOptions.extraFileExtensions" to your config

WHY?

thanks in advance

✖ 1 problem (1 error, 0 warnings)

`TypeError: Cannot read properties of null (reading 'range')` on editing in editor

Do we need to handle invalid YAML file? Especially when integrating with an editor.

image

2022-08-11T10:01:48.325Z eslint:linter Parser Options: {
  ecmaVersion: 13,
  ecmaFeatures: { globalReturn: false, jsx: true },
  sourceType: 'module'
}
2022-08-11T10:01:48.326Z eslint:linter Parser Path: /Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/yaml-eslint-parser/lib/index.js
2022-08-11T10:01:48.326Z eslint:linter Settings: {}
[Error - 6:01:48 PM] ESLint stack trace:
[Error - 6:01:48 PM] TypeError: Cannot read properties of null (reading 'range')
Occurred while linting /Users/JounQin/Workspaces/GitHub/dl-iconfont/.github/workflows/ci.yml:1
Rule: "json-schema-validator/no-invalid"
    at SourceCode.getTokenBefore (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/source-code/token-store/index.js:298:18)
    at Object.key (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint-plugin-json-schema-validator/lib/utils/ast/yaml.js:81:36)
    at errorDataToLoc (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint-plugin-json-schema-validator/lib/rules/no-invalid.js:272:41)
    at /Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint-plugin-json-schema-validator/lib/rules/no-invalid.js:235:32
    at validateData (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint-plugin-json-schema-validator/lib/rules/no-invalid.js:172:29)
    at Program (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint-plugin-json-schema-validator/lib/rules/no-invalid.js:234:21)
    at ruleErrorHandler (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/linter.js:1114:28)
    at /Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
    at CodePathAnalyzer.enterNode (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:795:23)
    at /Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/linter.js:1149:32
    at Array.forEach (<anonymous>)
    at runRules (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/linter.js:1144:15)
    at Linter._verifyWithoutProcessors (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/linter.js:1393:31)
    at Linter._verifyWithoutProcessors (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint-plugin-eslint-comments/lib/utils/patch.js:181:42)
    at Linter._verifyWithConfigArray (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/linter.js:1762:21)
    at Linter.verify (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/linter.js:1475:65)
    at Linter.ESLinter.verify (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint-plugin-mdx/lib/processors/options.js:33:19)
    at Linter.verifyAndFix (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/linter/linter.js:2021:29)
    at verifyText (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/cli-engine/cli-engine.js:245:48)
    at CLIEngine.executeOnText (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/cli-engine/cli-engine.js:917:26)
    at ESLint.lintText (/Users/JounQin/Workspaces/GitHub/dl-iconfont/node_modules/eslint/lib/eslint/eslint.js:592:23)
    at /Users/JounQin/.vscode/extensions/dbaeumer.vscode-eslint-2.2.6/server/out/eslintServer.js:1:23205
    at E (/Users/JounQin/.vscode/extensions/dbaeumer.vscode-eslint-2.2.6/server/out/eslintServer.js:1:18310)
    at Object.e.validate (/Users/JounQin/.vscode/extensions/dbaeumer.vscode-eslint-2.2.6/server/out/eslintServer.js:1:23164)
    at /Users/JounQin/.vscode/extensions/dbaeumer.vscode-eslint-2.2.6/server/out/eslintServer.js:1:210200

Relative $schema URIs should be resolved against the file's path, not the cwd

First of all thank you for adding $schema support, I can now remove the corresponding redundant eslint config. However, relative schema URIs are being resolved against the cwd (line 47 in schema.ts). This makes sense for schemas defined in .eslintrc, but relative URIs in a json file need to be resolved relative to the file.

feat: provide config options for schemastore cache

Would it be possible to provide options for json-schema-validator/no-invalid:

  1. Cache location. It seems to currently be hard coded to ./.cached_schemastore, but I'm using it in a docker container and that location isn't persisted between runs. I already have a persistent volume setup and I'd like to tell json-schema-validator to use that location.

  2. Cache TTL. Once I have json-schema-validator caching to a persistent location, I would like to tell it when to re-fetch the cached schema files.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

This repository currently has no open or pending branches.


  • Check this box to trigger a request for Renovate to run again on this repository

`"$schema"` should be preferred

Reproduction: https://github.com/1stG/configs/tree/master/packages/tsconfig

For example:

// app.json
{
  "$schema": "http://json.schemastore.org/tsconfig",
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "lib": [
      "DOM",
      "ESNext"
    ],
    "paths": {
      "*": [
        "src/*"
      ]
    },
    "outDir": "dist"
  }
}
// angular.json
{
  "$schema": "http://json.schemastore.org/tsconfig",
  "extends": "./ng-lib.json",
  "compilerOptions": {
    "declaration": false,
    "paths": {
      "*": ["src/*"]
    },
    "outDir": "dist"
  },
  "angularCompilerOptions": {
    "compilationMode": "full",
    "enableResourceInlining": false
  }
}

List on json-schema.org

Hello! My name is Benjamin from the JSON Schema Community. I came across this cool JSON Schema implementation, and I wanted to congratulate for the great work! KUDOS!

I noticed that it's not listed on our implementations page, but we'd love it to be.
If you'd like to add this implementation to that page, please feel free to create a pull request!

I'd like to use this opportunity to invite you to join the JSON Schema Community in Slack, where we have some interesting channels like #implementers where you could connect with other relevant maintainers in the ecosystem.

Thanks for enhancing the JSON Schema ecosystem!

setting the plug in to match specific json files to a specific local schema

I would like to setup the plugin with ESLint so that eslint command report any error when matching specific json files in the project to a schema I have created, however, I have a problem setting the plugin correctly,
my schema is inside a folder called config and its called config.schema.json, while the files I would like to match are inside subfolders and all called config.json.

I have the following in .eslintrc.js file:

 extends: [
         //
        'plugin:json-schema-validator/recommended',
    ],
  rules: {
       'json-schema-validator/no-invalid': [
            'error',
            {
                schemas: [
                    {
                        fileMatch: ['config/ing/config.json'],
                        schema: 'config/config.schema.json',
                    },
                ],
            },
        ],
}

I have enabled checking json file in .vscode/settings.js,

the problems I am facing are:
1- it doesn't match the specified json files to the schema and report errors.
2- there is a file called version.json in src folder the plugin keeps trying to match it to an online schema
p.s, if I put in the fileMatch field for schemas rule the .eslitrc.js it will work and tries to compare .eslintrc.js to my schema

`schema could not be resolved` when validating a schema file

I've created my own schema for some JSON files. Validating the JSON data against my schema works just fine. What doesn't work is validating my schema against JSON Schema Draft 7.

I always get the warning/error: Specified schema could not be resolved. Path: "http://json-schema.org/draft-07/schema#"

I've reproduced this with v5.0.0 and the following files, although I've tried several other options, e.g. setting useSchemastoreCatalog: true explicitly:

.eslintrc.json:

{
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": ["eslint:recommended", "plugin:json-schema-validator/recommended", "prettier"],
  "overrides": [],
  "parserOptions": {
    "ecmaVersion": "latest"
  }
}

test.schema.json:

{
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Full debug output
 eslint:cli CLI args: [ 'test.schema.json', '--debug' ] +0ms
  eslint:cli Using flat config? false +3ms
  eslint:cli Running on files +3ms
  eslintrc:config-array-factory Loading JSON config file: /home/marseu/Infoportal/package.json +0ms
  eslintrc:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/**/node_modules/*' ], basePath: '/home/marseu/Infoportal', loose: false } ] +0ms
  eslintrc:ignore-pattern   processed: { basePath: '/home/marseu/Infoportal', patterns: [ '/**/node_modules/*' ] } +2ms
  eslintrc:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/**/node_modules/*' ], basePath: '/home/marseu/Infoportal', loose: false } ] +1ms
  eslintrc:ignore-pattern   processed: { basePath: '/home/marseu/Infoportal', patterns: [ '/**/node_modules/*' ] } +1ms
  eslint:file-enumerator Start to iterate files: [ 'test.schema.json' ] +0ms
  eslint:file-enumerator File: /home/marseu/Infoportal/test.schema.json +1ms
  eslintrc:cascading-config-array-factory Load config files for /home/marseu/Infoportal. +0ms
  eslintrc:cascading-config-array-factory No cache found: /home/marseu/Infoportal. +0ms
  eslintrc:config-array-factory Loading JSON config file: /home/marseu/Infoportal/.eslintrc.json +6ms
  eslintrc:config-array-factory Config file found: /home/marseu/Infoportal/.eslintrc.json +0ms
  eslintrc:config-array-factory Loading {extends:"eslint:recommended"} relative to /home/marseu/Infoportal/.eslintrc.json +0ms
  eslintrc:config-array-factory Loading {extends:"plugin:json-schema-validator/recommended"} relative to /home/marseu/Infoportal/.eslintrc.json +1ms
  eslintrc:config-array-factory Loading plugin "json-schema-validator" from /home/marseu/Infoportal/.eslintrc.json +0ms
  eslintrc:config-array-factory Loaded: [email protected] (/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/index.js) +1ms
  eslintrc:config-array-factory Plugin /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/index.js loaded in: 87ms +87ms
  eslintrc:config-array-factory Loading {extends:"/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js"} relative to /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/index.js +0ms
  eslintrc:config-array-factory package.json was not found: Cannot find module '/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js/package.json'
Require stack:
- /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/index.js +0ms
  eslintrc:config-array-factory Loaded: /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js (/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js) +0ms
  eslintrc:config-array-factory Loading JS config file: /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js +1ms
  eslintrc:config-array-factory Loading plugin "json-schema-validator" from /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js +1ms
  eslintrc:config-array-factory Loaded: [email protected] (/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/index.js) +0ms
  eslintrc:config-array-factory Plugin /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/index.js loaded in: 0ms +0ms
  eslintrc:config-array-factory Loading parser "/home/marseu/Infoportal/node_modules/jsonc-eslint-parser/lib/index.js" from /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js +0ms
  eslintrc:config-array-factory package.json was not found: Cannot find module '/home/marseu/Infoportal/node_modules/jsonc-eslint-parser/lib/index.js/package.json'
Require stack:
- /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js +0ms
  eslintrc:config-array-factory Loaded: /home/marseu/Infoportal/node_modules/jsonc-eslint-parser/lib/index.js (/home/marseu/Infoportal/node_modules/jsonc-eslint-parser/lib/index.js) +0ms
  eslintrc:config-array-factory Loading parser "/home/marseu/Infoportal/node_modules/yaml-eslint-parser/lib/index.js" from /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js +1ms
  eslintrc:config-array-factory package.json was not found: Cannot find module '/home/marseu/Infoportal/node_modules/yaml-eslint-parser/lib/index.js/package.json'
Require stack:
- /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js +0ms
  eslintrc:config-array-factory Loaded: /home/marseu/Infoportal/node_modules/yaml-eslint-parser/lib/index.js (/home/marseu/Infoportal/node_modules/yaml-eslint-parser/lib/index.js) +0ms
  eslintrc:config-array-factory Loading parser "/home/marseu/Infoportal/node_modules/toml-eslint-parser/lib/index.js" from /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js +0ms
  eslintrc:config-array-factory package.json was not found: Cannot find module '/home/marseu/Infoportal/node_modules/toml-eslint-parser/lib/index.js/package.json'
Require stack:
- /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js +0ms
  eslintrc:config-array-factory Loaded: /home/marseu/Infoportal/node_modules/toml-eslint-parser/lib/index.js (/home/marseu/Infoportal/node_modules/toml-eslint-parser/lib/index.js) +0ms
  eslintrc:config-array-factory Loading {extends:"prettier"} relative to /home/marseu/Infoportal/.eslintrc.json +0ms
  eslintrc:config-array-factory Loaded: [email protected] (/home/marseu/Infoportal/node_modules/eslint-config-prettier/index.js) +0ms
  eslintrc:config-array-factory Loading JS config file: /home/marseu/Infoportal/node_modules/eslint-config-prettier/index.js +0ms
  eslintrc:cascading-config-array-factory No cache found: /home/marseu. +94ms
  eslintrc:cascading-config-array-factory Stop traversing because of considered root. +0ms
  eslint:rules Loading rule 'constructor-super' (remaining=290) +0ms
  eslint:rules Loading rule 'for-direction' (remaining=289) +1ms
  eslint:rules Loading rule 'getter-return' (remaining=288) +1ms
  eslint:rules Loading rule 'no-async-promise-executor' (remaining=287) +3ms
  eslint:rules Loading rule 'no-case-declarations' (remaining=286) +1ms
  eslint:rules Loading rule 'no-class-assign' (remaining=285) +0ms
  eslint:rules Loading rule 'no-compare-neg-zero' (remaining=284) +0ms
  eslint:rules Loading rule 'no-cond-assign' (remaining=283) +1ms
  eslint:rules Loading rule 'no-const-assign' (remaining=282) +0ms
  eslint:rules Loading rule 'no-constant-condition' (remaining=281) +1ms
  eslint:rules Loading rule 'no-control-regex' (remaining=280) +1ms
  eslint:rules Loading rule 'no-debugger' (remaining=279) +2ms
  eslint:rules Loading rule 'no-delete-var' (remaining=278) +0ms
  eslint:rules Loading rule 'no-dupe-args' (remaining=277) +0ms
  eslint:rules Loading rule 'no-dupe-class-members' (remaining=276) +0ms
  eslint:rules Loading rule 'no-dupe-else-if' (remaining=275) +1ms
  eslint:rules Loading rule 'no-dupe-keys' (remaining=274) +0ms
  eslint:rules Loading rule 'no-duplicate-case' (remaining=273) +0ms
  eslint:rules Loading rule 'no-empty' (remaining=272) +0ms
  eslint:rules Loading rule 'no-empty-character-class' (remaining=271) +1ms
  eslint:rules Loading rule 'no-empty-pattern' (remaining=270) +1ms
  eslint:rules Loading rule 'no-ex-assign' (remaining=269) +1ms
  eslint:rules Loading rule 'no-extra-boolean-cast' (remaining=268) +0ms
  eslint:rules Loading rule 'no-extra-semi' (remaining=267) +1ms
  eslint:rules Loading rule 'no-fallthrough' (remaining=266) +1ms
  eslint:rules Loading rule 'no-func-assign' (remaining=265) +1ms
  eslint:rules Loading rule 'no-global-assign' (remaining=264) +0ms
  eslint:rules Loading rule 'no-import-assign' (remaining=263) +1ms
  eslint:rules Loading rule 'no-inner-declarations' (remaining=262) +1ms
  eslint:rules Loading rule 'no-invalid-regexp' (remaining=261) +1ms
  eslint:rules Loading rule 'no-irregular-whitespace' (remaining=260) +1ms
  eslint:rules Loading rule 'no-loss-of-precision' (remaining=259) +1ms
  eslint:rules Loading rule 'no-misleading-character-class' (remaining=258) +0ms
  eslint:rules Loading rule 'no-mixed-spaces-and-tabs' (remaining=257) +2ms
  eslint:rules Loading rule 'no-new-symbol' (remaining=256) +1ms
  eslint:rules Loading rule 'no-nonoctal-decimal-escape' (remaining=255) +0ms
  eslint:rules Loading rule 'no-obj-calls' (remaining=254) +1ms
  eslint:rules Loading rule 'no-octal' (remaining=253) +0ms
  eslint:rules Loading rule 'no-prototype-builtins' (remaining=252) +0ms
  eslint:rules Loading rule 'no-redeclare' (remaining=251) +0ms
  eslint:rules Loading rule 'no-regex-spaces' (remaining=250) +1ms
  eslint:rules Loading rule 'no-self-assign' (remaining=249) +1ms
  eslint:rules Loading rule 'no-setter-return' (remaining=248) +1ms
  eslint:rules Loading rule 'no-shadow-restricted-names' (remaining=247) +5ms
  eslint:rules Loading rule 'no-sparse-arrays' (remaining=246) +1ms
  eslint:rules Loading rule 'no-this-before-super' (remaining=245) +0ms
  eslint:rules Loading rule 'no-undef' (remaining=244) +0ms
  eslint:rules Loading rule 'no-unexpected-multiline' (remaining=243) +1ms
  eslint:rules Loading rule 'no-unreachable' (remaining=242) +1ms
  eslint:rules Loading rule 'no-unsafe-finally' (remaining=241) +1ms
  eslint:rules Loading rule 'no-unsafe-negation' (remaining=240) +0ms
  eslint:rules Loading rule 'no-unsafe-optional-chaining' (remaining=239) +1ms
  eslint:rules Loading rule 'no-unused-labels' (remaining=238) +0ms
  eslint:rules Loading rule 'no-unused-vars' (remaining=237) +1ms
  eslint:rules Loading rule 'no-useless-backreference' (remaining=236) +1ms
  eslint:rules Loading rule 'no-useless-catch' (remaining=235) +0ms
  eslint:rules Loading rule 'no-useless-escape' (remaining=234) +0ms
  eslint:rules Loading rule 'no-with' (remaining=233) +1ms
  eslint:rules Loading rule 'require-yield' (remaining=232) +0ms
  eslint:rules Loading rule 'use-isnan' (remaining=231) +0ms
  eslint:rules Loading rule 'valid-typeof' (remaining=230) +1ms
  eslint:rules Loading rule 'curly' (remaining=229) +2ms
  eslint:rules Loading rule 'lines-around-comment' (remaining=228) +0ms
  eslint:rules Loading rule 'max-len' (remaining=227) +0ms
  eslint:rules Loading rule 'no-confusing-arrow' (remaining=226) +1ms
  eslint:rules Loading rule 'no-mixed-operators' (remaining=225) +0ms
  eslint:rules Loading rule 'no-tabs' (remaining=224) +0ms
  eslint:rules Loading rule 'quotes' (remaining=223) +0ms
  eslint:rules Loading rule 'array-bracket-newline' (remaining=222) +1ms
  eslint:rules Loading rule 'array-bracket-spacing' (remaining=221) +0ms
  eslint:rules Loading rule 'array-element-newline' (remaining=220) +0ms
  eslint:rules Loading rule 'arrow-parens' (remaining=219) +1ms
  eslint:rules Loading rule 'arrow-spacing' (remaining=218) +0ms
  eslint:rules Loading rule 'block-spacing' (remaining=217) +0ms
  eslint:rules Loading rule 'brace-style' (remaining=216) +0ms
  eslint:rules Loading rule 'comma-dangle' (remaining=215) +1ms
  eslint:rules Loading rule 'comma-spacing' (remaining=214) +0ms
  eslint:rules Loading rule 'comma-style' (remaining=213) +0ms
  eslint:rules Loading rule 'computed-property-spacing' (remaining=212) +0ms
  eslint:rules Loading rule 'dot-location' (remaining=211) +1ms
  eslint:rules Loading rule 'eol-last' (remaining=210) +0ms
  eslint:rules Loading rule 'func-call-spacing' (remaining=209) +1ms
  eslint:rules Loading rule 'function-call-argument-newline' (remaining=208) +0ms
  eslint:rules Loading rule 'function-paren-newline' (remaining=207) +1ms
  eslint:rules Loading rule 'generator-star-spacing' (remaining=206) +0ms
  eslint:rules Loading rule 'implicit-arrow-linebreak' (remaining=205) +0ms
  eslint:rules Loading rule 'indent' (remaining=204) +1ms
  eslint:rules Loading rule 'jsx-quotes' (remaining=203) +1ms
  eslint:rules Loading rule 'key-spacing' (remaining=202) +1ms
  eslint:rules Loading rule 'keyword-spacing' (remaining=201) +5ms
  eslint:rules Loading rule 'linebreak-style' (remaining=200) +1ms
  eslint:rules Loading rule 'max-statements-per-line' (remaining=199) +0ms
  eslint:rules Loading rule 'multiline-ternary' (remaining=198) +1ms
  eslint:rules Loading rule 'newline-per-chained-call' (remaining=197) +0ms
  eslint:rules Loading rule 'new-parens' (remaining=196) +0ms
  eslint:rules Loading rule 'no-extra-parens' (remaining=195) +0ms
  eslint:rules Loading rule 'no-floating-decimal' (remaining=194) +1ms
  eslint:rules Loading rule 'no-multi-spaces' (remaining=193) +1ms
  eslint:rules Loading rule 'no-multiple-empty-lines' (remaining=192) +0ms
  eslint:rules Loading rule 'no-trailing-spaces' (remaining=191) +0ms
  eslint:rules Loading rule 'no-whitespace-before-property' (remaining=190) +1ms
  eslint:rules Loading rule 'nonblock-statement-body-position' (remaining=189) +0ms
  eslint:rules Loading rule 'object-curly-newline' (remaining=188) +0ms
  eslint:rules Loading rule 'object-curly-spacing' (remaining=187) +0ms
  eslint:rules Loading rule 'object-property-newline' (remaining=186) +1ms
  eslint:rules Loading rule 'one-var-declaration-per-line' (remaining=185) +0ms
  eslint:rules Loading rule 'operator-linebreak' (remaining=184) +1ms
  eslint:rules Loading rule 'padded-blocks' (remaining=183) +0ms
  eslint:rules Loading rule 'quote-props' (remaining=182) +0ms
  eslint:rules Loading rule 'rest-spread-spacing' (remaining=181) +1ms
  eslint:rules Loading rule 'semi' (remaining=180) +0ms
  eslint:rules Loading rule 'semi-spacing' (remaining=179) +1ms
  eslint:rules Loading rule 'semi-style' (remaining=178) +0ms
  eslint:rules Loading rule 'space-before-blocks' (remaining=177) +1ms
  eslint:rules Loading rule 'space-before-function-paren' (remaining=176) +0ms
  eslint:rules Loading rule 'space-in-parens' (remaining=175) +0ms
  eslint:rules Loading rule 'space-infix-ops' (remaining=174) +1ms
  eslint:rules Loading rule 'space-unary-ops' (remaining=173) +0ms
  eslint:rules Loading rule 'switch-colon-spacing' (remaining=172) +0ms
  eslint:rules Loading rule 'template-curly-spacing' (remaining=171) +1ms
  eslint:rules Loading rule 'template-tag-spacing' (remaining=170) +0ms
  eslint:rules Loading rule 'unicode-bom' (remaining=169) +0ms
  eslint:rules Loading rule 'wrap-iife' (remaining=168) +0ms
  eslint:rules Loading rule 'wrap-regex' (remaining=167) +1ms
  eslint:rules Loading rule 'yield-star-spacing' (remaining=166) +0ms
  eslint:rules Loading rule 'indent-legacy' (remaining=165) +0ms
  eslint:rules Loading rule 'no-spaced-func' (remaining=164) +0ms
  eslintrc:cascading-config-array-factory Configuration was determined: ConfigArray(9) [ { type: 'config', name: 'DefaultIgnorePattern', filePath: '', criteria: null, env: undefined, globals: undefined, ignorePattern: IgnorePattern { patterns: [Array], basePath: '/home/marseu/Infoportal', loose: false }, noInlineConfig: undefined, parser: undefined, parserOptions: undefined, plugins: undefined, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: undefined, settings: undefined }, { type: 'config', name: '.eslintrc.json » eslint:recommended', filePath: '', criteria: null, env: undefined, globals: undefined, ignorePattern: undefined, noInlineConfig: undefined, parser: undefined, parserOptions: undefined, plugins: undefined, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: { 'constructor-super': 'error', 'for-direction': 'error', 'getter-return': 'error', 'no-async-promise-executor': 'error', 'no-case-declarations': 'error', 'no-class-assign': 'error', 'no-compare-neg-zero': 'error', 'no-cond-assign': 'error', 'no-const-assign': 'error', 'no-constant-condition': 'error', 'no-control-regex': 'error', 'no-debugger': 'error', 'no-delete-var': 'error', 'no-dupe-args': 'error', 'no-dupe-class-members': 'error', 'no-dupe-else-if': 'error', 'no-dupe-keys': 'error', 'no-duplicate-case': 'error', 'no-empty': 'error', 'no-empty-character-class': 'error', 'no-empty-pattern': 'error', 'no-ex-assign': 'error', 'no-extra-boolean-cast': 'error', 'no-extra-semi': 'error', 'no-fallthrough': 'error', 'no-func-assign': 'error', 'no-global-assign': 'error', 'no-import-assign': 'error', 'no-inner-declarations': 'error', 'no-invalid-regexp': 'error', 'no-irregular-whitespace': 'error', 'no-loss-of-precision': 'error', 'no-misleading-character-class': 'error', 'no-mixed-spaces-and-tabs': 'error', 'no-new-symbol': 'error', 'no-nonoctal-decimal-escape': 'error', 'no-obj-calls': 'error', 'no-octal': 'error', 'no-prototype-builtins': 'error', 'no-redeclare': 'error', 'no-regex-spaces': 'error', 'no-self-assign': 'error', 'no-setter-return': 'error', 'no-shadow-restricted-names': 'error', 'no-sparse-arrays': 'error', 'no-this-before-super': 'error', 'no-undef': 'error', 'no-unexpected-multiline': 'error', 'no-unreachable': 'error', 'no-unsafe-finally': 'error', 'no-unsafe-negation': 'error', 'no-unsafe-optional-chaining': 'error', 'no-unused-labels': 'error', 'no-unused-vars': 'error', 'no-useless-backreference': 'error', 'no-useless-catch': 'error', 'no-useless-escape': 'error', 'no-with': 'error', 'require-yield': 'error', 'use-isnan': 'error', 'valid-typeof': 'error' }, settings: undefined }, { type: 'config', name: '.eslintrc.json » plugin:json-schema-validator/recommended » /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js', filePath: '/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js', criteria: null, env: undefined, globals: undefined, ignorePattern: undefined, noInlineConfig: undefined, parser: undefined, parserOptions: undefined, plugins: { 'json-schema-validator': [Object] }, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: undefined, settings: undefined }, { type: 'config', name: '.eslintrc.json » plugin:json-schema-validator/recommended » /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js#overrides[0]', filePath: '/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js', criteria: { includes: [Array], excludes: null, basePath: '/home/marseu/Infoportal' }, env: undefined, globals: undefined, ignorePattern: undefined, noInlineConfig: undefined, parser: { error: null, filePath: '/home/marseu/Infoportal/node_modules/jsonc-eslint-parser/lib/index.js', id: '/home/marseu/Infoportal/node_modules/jsonc-eslint-parser/lib/index.js', importerName: '.eslintrc.json » plugin:json-schema-validator/recommended » /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js#overrides[0]', importerPath: '/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js' }, parserOptions: undefined, plugins: undefined, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: undefined, settings: undefined }, { type: 'config', name: '.eslintrc.json » plugin:json-schema-validator/recommended » /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js#overrides[1]', filePath: '/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js', criteria: { includes: [Array], excludes: null, basePath: '/home/marseu/Infoportal' }, env: undefined, globals: undefined, ignorePattern: undefined, noInlineConfig: undefined, parser: { error: null, filePath: '/home/marseu/Infoportal/node_modules/yaml-eslint-parser/lib/index.js', id: '/home/marseu/Infoportal/node_modules/yaml-eslint-parser/lib/index.js', importerName: '.eslintrc.json » plugin:json-schema-validator/recommended » /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js#overrides[1]', importerPath: '/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js' }, parserOptions: undefined, plugins: undefined, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: undefined, settings: undefined }, { type: 'config', name: '.eslintrc.json » plugin:json-schema-validator/recommended » /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js#overrides[2]', filePath: '/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js', criteria: { includes: [Array], excludes: null, basePath: '/home/marseu/Infoportal' }, env: undefined, globals: undefined, ignorePattern: undefined, noInlineConfig: undefined, parser: { error: null, filePath: '/home/marseu/Infoportal/node_modules/toml-eslint-parser/lib/index.js', id: '/home/marseu/Infoportal/node_modules/toml-eslint-parser/lib/index.js', importerName: '.eslintrc.json » plugin:json-schema-validator/recommended » /home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js#overrides[2]', importerPath: '/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/configs/base.js' }, parserOptions: undefined, plugins: undefined, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: undefined, settings: undefined }, { type: 'config', name: '.eslintrc.json » plugin:json-schema-validator/recommended', filePath: '/home/marseu/Infoportal/node_modules/eslint-plugin-json-schema-validator/lib/index.js', criteria: null, env: undefined, globals: undefined, ignorePattern: undefined, noInlineConfig: undefined, parser: undefined, parserOptions: undefined, plugins: undefined, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: { 'json-schema-validator/no-invalid': 'warn' }, settings: undefined }, { type: 'config', name: '.eslintrc.json » eslint-config-prettier', filePath: '/home/marseu/Infoportal/node_modules/eslint-config-prettier/index.js', criteria: null, env: undefined, globals: undefined, ignorePattern: undefined, noInlineConfig: undefined, parser: undefined, parserOptions: undefined, plugins: undefined, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: { curly: 0, 'lines-around-comment': 0, 'max-len': 0, 'no-confusing-arrow': 0, 'no-mixed-operators': 0, 'no-tabs': 0, 'no-unexpected-multiline': 0, quotes: 0, '@typescript-eslint/lines-around-comment': 0, '@typescript-eslint/quotes': 0, 'babel/quotes': 0, 'vue/html-self-closing': 0, 'vue/max-len': 0, 'array-bracket-newline': 'off', 'array-bracket-spacing': 'off', 'array-element-newline': 'off', 'arrow-parens': 'off', 'arrow-spacing': 'off', 'block-spacing': 'off', 'brace-style': 'off', 'comma-dangle': 'off', 'comma-spacing': 'off', 'comma-style': 'off', 'computed-property-spacing': 'off', 'dot-location': 'off', 'eol-last': 'off', 'func-call-spacing': 'off', 'function-call-argument-newline': 'off', 'function-paren-newline': 'off', 'generator-star-spacing': 'off', 'implicit-arrow-linebreak': 'off', indent: 'off', 'jsx-quotes': 'off', 'key-spacing': 'off', 'keyword-spacing': 'off', 'linebreak-style': 'off', 'max-statements-per-line': 'off', 'multiline-ternary': 'off', 'newline-per-chained-call': 'off', 'new-parens': 'off', 'no-extra-parens': 'off', 'no-extra-semi': 'off', 'no-floating-decimal': 'off', 'no-mixed-spaces-and-tabs': 'off', 'no-multi-spaces': 'off', 'no-multiple-empty-lines': 'off', 'no-trailing-spaces': 'off', 'no-whitespace-before-property': 'off', 'nonblock-statement-body-position': 'off', 'object-curly-newline': 'off', 'object-curly-spacing': 'off', 'object-property-newline': 'off', 'one-var-declaration-per-line': 'off', 'operator-linebreak': 'off', 'padded-blocks': 'off', 'quote-props': 'off', 'rest-spread-spacing': 'off', semi: 'off', 'semi-spacing': 'off', 'semi-style': 'off', 'space-before-blocks': 'off', 'space-before-function-paren': 'off', 'space-in-parens': 'off', 'space-infix-ops': 'off', 'space-unary-ops': 'off', 'switch-colon-spacing': 'off', 'template-curly-spacing': 'off', 'template-tag-spacing': 'off', 'unicode-bom': 'off', 'wrap-iife': 'off', 'wrap-regex': 'off', 'yield-star-spacing': 'off', '@babel/object-curly-spacing': 'off', '@babel/semi': 'off', '@typescript-eslint/block-spacing': 'off', '@typescript-eslint/brace-style': 'off', '@typescript-eslint/comma-dangle': 'off', '@typescript-eslint/comma-spacing': 'off', '@typescript-eslint/func-call-spacing': 'off', '@typescript-eslint/indent': 'off', '@typescript-eslint/key-spacing': 'off', '@typescript-eslint/keyword-spacing': 'off', '@typescript-eslint/member-delimiter-style': 'off', '@typescript-eslint/no-extra-parens': 'off', '@typescript-eslint/no-extra-semi': 'off', '@typescript-eslint/object-curly-spacing': 'off', '@typescript-eslint/semi': 'off', '@typescript-eslint/space-before-blocks': 'off', '@typescript-eslint/space-before-function-paren': 'off', '@typescript-eslint/space-infix-ops': 'off', '@typescript-eslint/type-annotation-spacing': 'off', 'babel/object-curly-spacing': 'off', 'babel/semi': 'off', 'flowtype/boolean-style': 'off', 'flowtype/delimiter-dangle': 'off', 'flowtype/generic-spacing': 'off', 'flowtype/object-type-curly-spacing': 'off', 'flowtype/object-type-delimiter': 'off', 'flowtype/quotes': 'off', 'flowtype/semi': 'off', 'flowtype/space-after-type-colon': 'off', 'flowtype/space-before-generic-bracket': 'off', 'flowtype/space-before-type-colon': 'off', 'flowtype/union-intersection-spacing': 'off', 'react/jsx-child-element-spacing': 'off', 'react/jsx-closing-bracket-location': 'off', 'react/jsx-closing-tag-location': 'off', 'react/jsx-curly-newline': 'off', 'react/jsx-curly-spacing': 'off', 'react/jsx-equals-spacing': 'off', 'react/jsx-first-prop-new-line': 'off', 'react/jsx-indent': 'off', 'react/jsx-indent-props': 'off', 'react/jsx-max-props-per-line': 'off', 'react/jsx-newline': 'off', 'react/jsx-one-expression-per-line': 'off', 'react/jsx-props-no-multi-spaces': 'off', 'react/jsx-tag-spacing': 'off', 'react/jsx-wrap-multilines': 'off', 'standard/array-bracket-even-spacing': 'off', 'standard/computed-property-even-spacing': 'off', 'standard/object-curly-even-spacing': 'off', 'unicorn/empty-brace-spaces': 'off', 'unicorn/no-nested-ternary': 'off', 'unicorn/number-literal-case': 'off', 'vue/array-bracket-newline': 'off', 'vue/array-bracket-spacing': 'off', 'vue/array-element-newline': 'off', 'vue/arrow-spacing': 'off', 'vue/block-spacing': 'off', 'vue/block-tag-newline': 'off', 'vue/brace-style': 'off', 'vue/comma-dangle': 'off', 'vue/comma-spacing': 'off', 'vue/comma-style': 'off', 'vue/dot-location': 'off', 'vue/func-call-spacing': 'off', 'vue/html-closing-bracket-newline': 'off', 'vue/html-closing-bracket-spacing': 'off', 'vue/html-end-tags': 'off', 'vue/html-indent': 'off', 'vue/html-quotes': 'off', 'vue/key-spacing': 'off', 'vue/keyword-spacing': 'off', 'vue/max-attributes-per-line': 'off', 'vue/multiline-html-element-content-newline': 'off', 'vue/multiline-ternary': 'off', 'vue/mustache-interpolation-spacing': 'off', 'vue/no-extra-parens': 'off', 'vue/no-multi-spaces': 'off', 'vue/no-spaces-around-equal-signs-in-attribute': 'off', 'vue/object-curly-newline': 'off', 'vue/object-curly-spacing': 'off', 'vue/object-property-newline': 'off', 'vue/operator-linebreak': 'off', 'vue/quote-props': 'off', 'vue/script-indent': 'off', 'vue/singleline-html-element-content-newline': 'off', 'vue/space-in-parens': 'off', 'vue/space-infix-ops': 'off', 'vue/space-unary-ops': 'off', 'vue/template-curly-spacing': 'off', 'generator-star': 'off', 'indent-legacy': 'off', 'no-arrow-condition': 'off', 'no-comma-dangle': 'off', 'no-reserved-keys': 'off', 'no-space-before-semi': 'off', 'no-spaced-func': 'off', 'no-wrap-func': 'off', 'space-after-function-name': 'off', 'space-after-keywords': 'off', 'space-before-function-parentheses': 'off', 'space-before-keywords': 'off', 'space-in-brackets': 'off', 'space-return-throw-case': 'off', 'space-unary-word-ops': 'off', 'react/jsx-space-before-closing': 'off' }, settings: undefined }, { type: 'config', name: '.eslintrc.json', filePath: '/home/marseu/Infoportal/.eslintrc.json', criteria: null, env: { browser: true, es2021: true }, globals: undefined, ignorePattern: undefined, noInlineConfig: undefined, parser: undefined, parserOptions: { ecmaVersion: 'latest' }, plugins: undefined, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: undefined, settings: undefined } ] on /home/marseu/Infoportal +75ms
  eslintrc:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/**/node_modules/*' ], basePath: '/home/marseu/Infoportal', loose: false } ] +173ms
  eslintrc:ignore-pattern   processed: { basePath: '/home/marseu/Infoportal', patterns: [ '/**/node_modules/*' ] } +0ms
  eslintrc:ignore-pattern Check {
  filePath: '/home/marseu/Infoportal/test.schema.json',
  dot: false,
  relativePath: 'test.schema.json',
  result: false
} +1ms
  eslint:cli-engine Lint /home/marseu/Infoportal/test.schema.json +0ms
  eslint:linter Linting code for /home/marseu/Infoportal/test.schema.json (pass 1) +0ms
  eslint:linter Verify +0ms
  eslint:linter With ConfigArray: /home/marseu/Infoportal/test.schema.json +0ms
  eslint:linter Parsing: /home/marseu/Infoportal/test.schema.json +1ms
  eslint:linter Parsing successful: /home/marseu/Infoportal/test.schema.json +5ms
  eslint:linter Scope analysis: /home/marseu/Infoportal/test.schema.json +0ms
  eslint:linter Scope analysis successful: /home/marseu/Infoportal/test.schema.json +1ms
  eslint:linter Generating fixed text for /home/marseu/Infoportal/test.schema.json (pass 1) +365ms
  eslint:source-code-fixer Applying fixes +0ms
  eslint:source-code-fixer shouldFix parameter was false, not attempting fixes +0ms
  eslint:file-enumerator Complete iterating files: ["test.schema.json"] +546ms
  eslint:cli-engine Linting complete in: 547ms +373ms

/home/marseu/Infoportal/test.schema.json
  1:1  warning  Specified schema could not be resolved. Path: "http://json-schema.org/draft-07/schema#"  json-schema-validator/no-invalid

✖ 1 problem (0 errors, 1 warning)

[Bug] context.parserServices.defineTemplateBodyVisitor is not a function

I'm seeing the same issue for this plugin that is occurring here: ota-meshi/eslint-plugin-jsonc#31

I've added vue-eslint-parser and eslint-plugin-vue as dev dependencies but the problem remains.

For now I've manually disabled the individual rules from the vuejs-accessibility but this is quite a brittle workaround.

I also have the following in my eslintrc:

"overrides": [
    {
      "files": ["*.json", "*.jsonc", "*.json5", "*.json6"],
      "parserOptions": {
        "parser":"jsonc-eslint-parser",
      }
    }
  ],

Support extending $schema with plugin options

What do I want?

Instead of using only the schema referenced at the $schemaPath, I would like this plugin to validate the schema at $schemaPath together with all schemas defined in option.schemas.

Why would this be useful?

I am working with a monorepo that uses a large number of generators to bootstrap new libraries. Many of these come with .json files with their dedicated JsonSchema referenced at $schema. If I want to add validations to the schema of certain files across the monorepo I currently have two options:

  1. manually manage a large number of schema files and their imports
  2. remove the $schema field and apply the original schemas and added validations in the configuration for this plugin
    Both options are rather tedious and it would help a lot if there was an option to merge some additional validations into the existing $schema.

What could this look like?

Based on the boolean configuration option mergeSchema we could add an additional option.schemas object for the $schemaPath. E.g.

// src/rules/no-invalid.ts:217
create(context, { filename }) {
  const $schemaPath = findSchemaPath(context.getSourceCode().ast);
  
  const mergeSchemas = context.options[0]?.mergeSchemas;

  let validator: Validator;
  if (!mergeSchemas && $schemaPath != null) { // Don't take this path if merging schemas
    const v = schemaPathToValidator($schemaPath, context);
    if (!v) {
      reportCannotResolvedPath($schemaPath, context);
      return {};
    }
    validator = v;
  } else {
    const cwd = getCwd(context);

    const option = context.options[0] || {};

    // Append the additional schema. If option.mergeSchemas is defined, option are not a string
    if (mergeSchemas && $schemaPath) {
        const $schemaValidator = { schema: $schemaPath, fileMatch: ['*'] };
        option.schemas = [$schemaSchema, ...(option.schemas || [])];
    }

    const v = parseOption(
      option,
      context,
      filename.startsWith(cwd) ? path.relative(cwd, filename) : filename,
    );
    if (!v) {
      return {};
    }
    validator = v;
  }
  // ...

I tested this already and it works smoothly. If this change is accepted, I would gladly take this up and create a PR! :)

[oom] out of memory

I use this plugin in a big monorepo project which contains 80+ packages.

When I add packages/** to workspaces field in package.json, this plugin will eat memory endlessly:

image

report incorrect trailing comma in JSON

I often write invalid JSON files because the trailing commas are not deleted after some changes. Does this plugin help report this kind of errors? I am using the latest version of this plugin with "extends": ["plugin:json-schema-validator/base"]. I have also tried setting "parserOptions": { "ecmaVersion": 3 } or "rules": { "comma-dangle": "error" }, but none of them seems to work.

Failed to load plugin 'json-schema-validator' declared in '.eslintrc.js' No valid exports main found for eslint-utils

I have installed the plugin to validate json files according to a custom schema, however, when this plugin is installed and referenced in the .eslintrc.js file, running the eslint command: eslint --ext ts,tsx,js,json --quiet . generates this error, I upgraded eslint to v7.30 but nothing changed.

Oops! Something went wrong! :(

ESLint: 7.30.0

Error: Failed to load plugin 'json-schema-validator' declared in '.eslintrc.js': No valid exports main found for '/home/mahmoud/project-ui/node_modules/eslint-utils'
Referenced from: /home/mahmoud/project-ui/.eslintrc.js
    at resolveExportsTarget (internal/modules/cjs/loader.js:622:9)
    at applyExports (internal/modules/cjs/loader.js:499:14)
    at resolveExports (internal/modules/cjs/loader.js:548:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:654:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:953:27)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (/home/mahmoud/project-ui/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/mahmoud/project-ui/node_modules/jsonc-eslint-parser/lib/parser/convert.js:4:24)
    at Module._compile (/home/mahmoud/project-ui/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)

Including a custom schema

How would I go about validating a given JSON file against a custom schema? i.e. one provided in my own project and not in the schemastore.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.