Invalid config for react/jsx-uses-react?
See original GitHub issueI’m using atom, with the nuclide plugin and sometimes, the linter doesn’t work.
Here’s the error I see in the console:
/Users/tommy.leunen/.atom/packages/nuclide/pkg/nuclide-diagnostics-store/lib/LinterAdapter.js:20 Uncaught (in promise) Error: /Users/tommy.leunen/dev/project/node_modules/eslint-config-airbnb/rules/react.js:
Configuration for rule "react/jsx-uses-react" is invalid:
Value "[object Object]" has more items than allowed.
Referenced from: airbnb
Referenced from: /Users/tommy.leunen/dev/project/.eslintrc
at validateRuleOptions (/Users/tommy.leunen/dev/project/node_modules/eslint/lib/config/config-validator.js:116:15)
at /Users/tommy.leunen/dev/project/node_modules/eslint/lib/config/config-validator.js:163:13
at Array.forEach (native)
at Object.validate (/Users/tommy.leunen/dev/project/node_modules/eslint/lib/config/config-validator.js:162:35)
at load (/Users/tommy.leunen/dev/project/node_modules/eslint/lib/config/config-file.js:523:19)
at /Users/tommy.leunen/dev/project/node_modules/eslint/lib/config/config-file.js:392:36
at Array.reduceRight (native)
at applyExtends (/Users/tommy.leunen/dev/project/node_modules/eslint/lib/config/config-file.js:363:28)
at load (/Users/tommy.leunen/dev/project/node_modules/eslint/lib/config/config-file.js:530:22)
at /Users/tommy.leunen/dev/project/node_modules/eslint/lib/config/config-file.js:392:36
at Array.reduceRight (native)
at applyExtends (/Users/tommy.leunen/dev/project/node_modules/eslint/lib/config/config-file.js:363:28)
at Object.load (/Users/tommy.leunen/dev/project/node_modules/eslint/lib/config/config-file.js:530:22)
at loadConfig (/Users/tommy.leunen/dev/project/node_modules/eslint/lib/config.js:64:33)
at new Config (/Users/tommy.leunen/dev/project/node_modules/eslint/lib/config.js:233:38)
at CLIEngine.executeOnText (/Users/tommy.leunen/dev/project/node_modules/eslint/lib/cli-engine.js:748:28)
I don’t override the jsx-uses-react
rule.
eslint-config-airbnb@9.0.1
eslint-plugin-react@5.2.2
It looks like this happen when linting a file that doesn’t have any JSX.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Error keeps popping up: Configuration for rule "react/jsx-uses ...
I have tried a reinstall of eslint, eslint-plugin-import, eslint-config-airbnb, eslint-plugin-react, but no results. any ideas? error: Error: C ...
Read more >12 essential ESLint rules for React - LogRocket Blog
Introduction. ESLint has a comprehensive set of rules for JavaScript code that cover stylistic choices and prevent common bugs. Using ESLint ...
Read more >Invalid Hook Call Warning - React
There are three common reasons you might be seeing it: You might have mismatching versions of React and React DOM. You might be...
Read more >eslint-plugin-react | Yarn - Package Manager
owner jsx-eslint63.1mMIT7.31.11TS vulns 0 vulnerabilities. React specific linting rules for ESLint ... npm install eslint eslint-plugin-react --save-dev.
Read more >Eslint-plugin-react NPM
If you are using the new JSX transform from React 17, extend react/jsx-runtime in your eslint config (add "plugin:react/jsx-runtime" to "extends" ) to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The usual cause of this error is that your editor is using the global eslint instead of the local one - although the stack trace doesn’t seem to indicate that.
You may want to update to the latest eslint, eslint-config-airbnb, and eslint-plugin-react, but I’m not sure why your error is happening.
@ljharb happened to me with atom
removing the “global eslint instead of the local one” solved this for me