question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Schema JSON validation fails with ESLint 4.2.0

See original GitHub issue

Tell us about your environment

  • ESLint Version: 4.2.0
  • Node Version: 6.9.2
  • npm Version: 3.10.2

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration: N/A

What did you do? Please include the actual source code causing the issue.

It seems that ESLint has upgraded its JSON validator for 4.2.0: eslint/eslint#8852

Note: It’s only a guess that the above change has caused the problems, but it’s not fully confirmed.

This is causing issues for a rule in eslint-plugin-react:. It seems that the following schema validation is causing problems: https://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/jsx-curly-spacing.js#L34

The produced error:

can't resolve reference #/definitions/basicConfig from id #
can't resolve reference #/definitions/basicConfigOrBoolean from id #
Warning: [object Object]:
        Configuration for rule "react/jsx-curly-spacing" is invalid:
refVal[2] is not a function Use --force to continue.
 at validateRuleOptions (node_modules\eslint\lib\config\config-validator.js:112:15)
      at Object.keys.forEach.id (node_modules\eslint\lib\config\config-validator.js:152:9)
      at Array.forEach (native)
      at validateRules (node_modules\eslint\lib\config\config-validator.js:151:30)
      at Object.validate (node_modules\eslint\lib\config\config-validator.js:206:5)
      at runRuleForItem (node_modules\eslint\lib\testers\rule-tester.js:331:23)
      at testValidTemplate (node_modules\eslint\lib\testers\rule-tester.js:413:28)
      at Context.RuleTester.it (node_modules\eslint\lib\testers\rule-tester.js:546:25)

The issue can be reproduced by cloning the eslint-plugin-react repo and running npm run test.

What did you expect to happen?

No errors.

What actually happened? Please include the actual, raw output from ESLint.

See above.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:24 (7 by maintainers)

github_iconTop GitHub Comments

8reactions
epoberezkincommented, Jul 9, 2017

I think it was a breaking change but released with a minor version for some reason.

@mysticatea Ajv is supposed to ignore missing $ref, will release a fix.

4reactions
jseminckcommented, Jul 12, 2017

I think this can be closed now, right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-json-schema-validator - npm
ESLint plugin that validates data using JSON Schema Validator.. Latest version: 4.0.3, last published: a month ago.
Read more >
ajv-errors plugin with Fastify gives error as Cannot find ...
I am using Fastify middleware. My purpose is to wrap the default schema error validation messages to my own messages, as per my...
Read more >
create-accurapp@4.0.0-beta.12 vulnerabilities - Snyk
Overview. ajv is an Another JSON Schema Validator. Affected versions of this package are vulnerable to Prototype Pollution. A carefully crafted JSON schema...
Read more >
tv4-reporter | Yarn - Package Manager
Reporters to display usable Tiny Validator tv4 output of json-schema validation. This module is used by various dependents to render tv4 validation result ......
Read more >
Understanding JSON Schema
own car—er, writing their own JSON Schema validator—just yet. ... the first example against this schema, you can see that it fails:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found