Hi, I'm having this problem when building the project:
/node_modules/eslint-config-airbnb-base/rules/es6.js:
08:39:17.462 Configuration for rule "arrow-parens" is invalid:
08:39:17.462 Value "as-needed,[object Object]" has more items than allowed.
Referenced from: /srv/node_modules/proj-conf/[.eslintrc](https://github.com/airbnb/javascript/files/969918/default.eslintrc.txt)
08:39:17.470 at validateRuleOptions (/srv/node_modules/eslint/lib/config/config-validator.js:116:15)
08:39:17.470 at /srv/node_modules/eslint/lib/config/config-validator.js:163:13
08:39:17.470 at Array.forEach (native)
08:39:17.470 at Object.validate (/srv/node_modules/eslint/lib/config/config-validator.js:162:35)
08:39:17.470 at load (/srv/node_modules/eslint/lib/config/config-file.js:523:19)
08:39:17.470 at /srv/node_modules/eslint/lib/config/config-file.js:392:36
08:39:17.470 at Array.reduceRight (native)
08:39:17.470 at applyExtends (/srv/node_modules/eslint/lib/config/config-file.js:363:28)
08:39:17.471 at load (/srv/node_modules/eslint/lib/config/config-file.js:530:22)
08:39:17.471 at /srv/node_modules/eslint/lib/config/config-file.js:392:36
08:39:17.498 error Command failed with exit code 1.
The problem is that the rule is set to "0" and the default is set to
['error', 'as-needed', { requireForBlockBody: true, }].
Did someone had this problem too? Could someone help me with this issue?
Thank you
PS:
"dependencies": {
"eslint": "3.19.0",
"eslint-config-airbnb": "14.1.0",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "4.0.0",
"eslint-plugin-react": "6.10.3"
}
Hi @flavium, I got the same issue today with the exact same package.json settings. Have you figured out how to solve it, or does anybody else knows it?
What could be wrong here? Or is something else causing this issue? You can find my setup here.
Related Issues
_Edited: added links to other issue and my example.... Current Status: Solved._
Are you sure you're running the local eslint? Issues with rule options like this often mean you're running an older eslint.
@ljharb what do you mean with "running the local eslint"? I installed it with npm install eslint but also with npm install eslint -g while testing why this bug occurs.
That's not a useful test. I mean under no circumstances should you ever have the global one even installed, let alone use it.
For testing, do ./node_modules/.bin/eslint path or use your npm run-script.
I mean under no circumstances should you ever have the global one even installed, let alone use it.
@ljharb thanks for telling me that. Did not know that.
Actually I just solved it. The test.js file I used to check if the rule is applied did not require jsdoc comments. That is why no error occured. Thank you anyway and sorry for the buzz.
Status: solved
When I'm testing locally works fine, no errors, but when i'm building the project using yarn, running package scripts, i'm getting this error
@flavium that's your problem. yarn doesn't respect automatic updating of semver ranges, so you probably aren't actually using the latest eslint in your yarn.lock file.
I did check. Yarn.lock contains the latest dependencies. I deleted yarn.lock, updated dependencies in package json, then install using yarn. A new yarn.lock file was created using the new dependencies. This didn't solved the issue.
I think I wasn't clear. This error appears when running eslint after installation. Package installation works just fine.
Right; I'm suggesting that the installed eslint version isn't correct. What does ./node_modules/.bin/eslint --version say?
I double checked all dependencies before and after installation (node_modules). The eslint version is 3.19.0. All dependencies have the correct version. Maybe the error occurs because some packages incompatibility?
Hmm - can you provide a repo where I can reproduce this?
Sorry, unfortunately I can't.
But I cand tell you that this dependencies:
"dependencies": {
"eslint": "3.19.0",
"eslint-config-airbnb": "14.1.0",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "4.0.0",
"eslint-plugin-react": "6.10.3"
}
are used by a "module". This module is building fine and it's used by other "modules" as a devDependencie. The error occurs on testing those modules after installation.
Oh hmm, that's very much not the standard way to use eslint. So your module is like a runner for eslint?
If you can reproduce the issue in the project that has eslint directly defined, I can help, but otherwise I'd need the full setup (and it's almost certainly an eslint issue, not an Airbnb config issue - you'll probably be able to reproduce it with that one rule's config and none of airbnb's stuff)
Yes, my module is like a runner for eslint. So you say, somehow, i have an older version of eslint, or the setup has problems...
But, you see, all the setup worked fine until this error poped out in the past 2 weeks
Right; this config released an update that contained a new rule configuration option which requires a newer version of eslint; prior to that, you would still have had the older version of eslint, but you simply wouldn't have ran into this problem.
In other words, the recent config change exposed this preexisting issue in your dep graph.
Hi,
I solved the mystery. The problem is sass-lint. Its version of es-lint is ^2.7.0 . Sass-lint installs version 2.13.0 of es-lint witch conflicts with my 3.19.0 version of es-lint. So, I thing this issue can be closed.
Thank you for your support
Most helpful comment
Hi,
I solved the mystery. The problem is sass-lint. Its version of es-lint is ^2.7.0 . Sass-lint installs version 2.13.0 of es-lint witch conflicts with my 3.19.0 version of es-lint. So, I thing this issue can be closed.
Thank you for your support