eslint-config-standard: Error while running ESLint
So I’ve been using create-react-app and decided to install eslint-config-standard by:
yarn add eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node --dev
And here is my .eslintrc
{
"extends": "standard"
}
Any help?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 16 (3 by maintainers)
You need to update ESLint to the latest version.
npm install eslint@latest@MarkLunney I would double check that you aren’t running a globally-installed
eslintby accident, and that if you do run a global version, that it’s also updated:FYI, I got a similar error when trying to add
"allowSeparatedGroups": trueoption tosort-imports:Turned out that it was only added recently in version 7.5.0 and I was still on 6.8.0.
If you run into a similar error, check your ESLint version and when certain options may have been added.
Hi,
I’m still receiving this error after updating all of my dependencies. Anything I might’ve missed?
[Error - 16:36:40] /Users/mark.lunney/Documents/react-component-library/node_modules/eslint-config-standard/index.js: Configuration for rule “indent” is invalid: Value “[object Object]” should NOT have additional properties. Referenced from: /Users/mark.lunney/Documents/react-component-library/.eslintrc
package.json:
eslintrc:
Would be nice for the documentation to indicate when options were added (if added later than the rule). Only saying when the rule was added surely leads to lots of head scratching and extra time searching through release notes or Git history.
Hahaha sorry about that
IT WORKS 😃 THANK YOU!!!
I really appreciate your help.
Best,
Harry
~With create-react-app 1.x, if you
npm i eslint@latestyou run into this https://github.com/standard/eslint-config-standard-react/issues/48~~Reverting https://github.com/standard/eslint-config-standard/commit/5ad91a8ffa5ae064c52e78c06cef4c2fda5a8cba fixes it.~
~Alternatively,
npm i -D eslint-config-standard@10.2.1will fix it.~~All this to say, if you want Standard + CRA, then you need to downgrade that indent rule until CRA supports eslint@5+.~
https://github.com/standard/eslint-config-standard-react/issues/48 is fixed in https://github.com/standard/eslint-config-standard-react/pull/49 so
yarn add eslint@5should work. 👍If you’re using CRA + react-app-rewired (rewire-ESLint), then you’ll have 2 versions of ESLint (4 from CRA and the 5 you manually installed). Fix this with Yarn resolutions or you’ll get random weird linting errors.
Example rewired package.json with a ton of Standard stuff:
FYI, I just released ESLint 5 versions of all the standard packages just now. So you can go all in on ESLint 5 if you wish to, or stay locked to the ESLint 4 versions, up to you.