Javascript: JS error thrown with Atom eslint plugin

Created on 25 Aug 2016  ·  15Comments  ·  Source: airbnb/javascript

using:

├── [email protected]
├── [email protected]
├── [email protected]
Error: /Users/ethanc/workspace/eslint-plugin-jsx-a11y/node_modules/eslint-config-airbnb-base/rules/style.js:
    Configuration for rule "indent" is invalid:
    Value "data["1"].outerIIFEBody" has additional properties.
Referenced from: airbnb-base
Referenced from: /Users/ethanc/workspace/eslint-plugin-jsx-a11y/.eslintrc
    at validateRuleOptions (/Users/ethanc/workspace/eslint-plugin-jsx-a11y/node_modules/eslint/lib/config/config-validator.js:116:15)
    at /Users/ethanc/workspace/eslint-plugin-jsx-a11y/node_modules/eslint/lib/config/config-validator.js:163:13
    at Array.forEach (native)
    at Object.validate (/Users/ethanc/workspace/eslint-plugin-jsx-a11y/node_modules/eslint/lib/config/config-validator.js:162:35)
    at load (/Users/ethanc/workspace/eslint-plugin-jsx-a11y/node_modules/eslint/lib/config/config-file.js:523:19)
    at /Users/ethanc/workspace/eslint-plugin-jsx-a11y/node_modules/eslint/lib/config/config-file.js:392:36
    at Array.reduceRight (native)
    at applyExtends (/Users/ethanc/workspace/eslint-plugin-jsx-a11y/node_modules/eslint/lib/config/config-file.js:363:28)
    at load (/Users/ethanc/workspace/eslint-plugin-jsx-a11y/node_modules/eslint/lib/config/config-file.js:530:22)
    at /Users/ethanc/workspace/eslint-plugin-jsx-a11y/node_modules/eslint/lib/config/config-file.js:392:36

Most helpful comment

Yeah I just tried reinstalling everything and it works no problem now. Right after my comment ahah

All 15 comments

it looks like you're using a globally installed eslint - try npm uninstall -g eslint (or check the "local" box in atom).

specifically, the stack trace is using the eslint version _inside_ eslint-plugin-jsx-a11y - I'm not sure why it's there, but I assume it's npm v2 auto-installing peer deps, and that the plugin is globally installed.

i don't have eslint installed globally, and am using npm v3 node v5.11.1. I have eslint as a devDependency of eslint-plugin-jsx-a11y (meta, i know) and it looks like it's using that one. I encountered this when updating from eslint v2 => v3 and eslint-config-airbnb-base v3 => v5

hm, interesting - i'm not really sure how to solve it. So you're trying to lint the /Users/ethanc/workspace/eslint-plugin-jsx-a11y/ project itself - with a linter config that depends on your own project - that seems tricky :-)

haha thats why i used eslint-config-airbnb-base - don't think it has any of the react stuff 😄

touché, it does not :-)

if you can point me at a sha on your repo that i can use to reproduce it on the command line, i can definitely figure it out, but I don't use atom :-/

not happening on command line, so maybe i'm filing bug in the wrong place? ill dig deeper into it when I get a chance and update here in case anyone else is having this issue.

Hey I ran into the same exact issue. As you can imagine the error refers to this rule

indent: ['error', 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }]

There is something wrong with outerIIFEBody, removing that option from indent makes everything else work. I noticed there was an issue that supposedly got fixed where this config would take a boolean and now it takes a number. So yeah the error is generated right here.

@Gabri3l if you thus get that error, the wrong version of eslint is being used.

Yeah I just tried reinstalling everything and it works no problem now. Right after my comment ahah

@Gabri3l i just blew out my node_modules and reinstalled and it worked with same versions. weird. thanks!

├── [email protected]
├── [email protected]
├── [email protected]

I'm running into the same error 😢

I have removed node_modules then installed again but still getting this error.
It only works when I remove outerIIFEBody: 1 from style.js

├── [email protected]
├── [email protected]
├── [email protected]

@james075 make sure you update all lint-related packages in atom, and then restart atom

I did, but it still does not work
screen shot 2016-09-05 at 5 00 22 pm

@james075 if you are still having issues please file a bug on linter-eslint, I'm _guessing_ that it is pulling the wrong eslint instance for some reason but that's a problem that should be diagnosed over there as it has nothing to do with this project :wink:.

Was this page helpful?
0 / 5 - 0 ratings