This error just starting popping up in Atom after installing v12.0.0.
Configuration for rule "class-methods-use-this" is invalid: Value "[object Object]" has more items than allowed.
This causes an error message every time you type in Atom, and the live linter does not work.
Nevermind, I restarted Atom and this error went away...
I still have this issue and a restart of Atom does not seem to help. If I switch back to v10.0.1 it works fine, but any version later, from 11.0.0 to 12.0.0 cause the Atom error to pop-up.
@PeterHB999 have you installed all the dependencies that the config requires? Try using the command in the readme, and make sure you have the right version of eslint installed - before restarting Atom.
@ljharb I believe I have. As a simple check I created a new directory, changed into it, used npm init to create a package.json file, ran the command from the read me:
(
export PKG=eslint-config-airbnb;
npm info "$PKG" peerDependencies --json | command sed 's/[{},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"
)
Created a .eslinrc file and added "extends": "airbnb" to it.
I then added an index.js file, entered a few lines of code, saved the file and got the error pop-up with 'Configuration for rule "class-methods-use-this" is invalid: Value "[object Object]" has more items than allowed.'
I then changed the version of eslint-config-airbnb in package.json from 12.0.0 to 10.0.1 and ran npm update.
I then saved the index.js file again and this time the linter worked as expected, with the correct messages shown in Atom as normal.
I am running Atom 1.10.2 on macOS Sierra. I have version 1.11.16 of the linter package and version 7.3.2 of linter-eslint, which I believe are all the latest versions.
Am I missing something?
@PeterHB999 do you have a global eslint? i think by default atom runs the global one, not the local one? npm uninstall -g eslint to be sure.
@ljharb That was it! My global version of eslint was at 3.4.0. After updating it to 3.6.0 and also updating my global eslint-plugins to their latest versions (eslint-plugin-import to 1.16.0, eslint-plugin-jsx-a11y to 2.2.2 and eslint-plugin-react to 6.3.0) everything is working properly with 12.0.0 in Atom. Thank you!
I recommend uninstalling the global one entirely; everything should be locally installed.
Yes, that makes sense. Thank you.
I'm getting this error also - it may be the new eslint version:
Configuration for rule "class-methods-use-this" is invalid:
Value "[object Object]" has more items than allowed.
We've been using [email protected] for quite a while. I've cleared npm cache and don't have any global eslint is installed, and my local version is updated to v3.18.0.
I'm using Node v5.10.1, yarn, and gulp-eslint btw, if that helps.
@Mode7James i suspect you'll need to upgrade all the peer deps, per the install command in the readme. yarn's lockfile behavior prevents peer deps from being seamlessly upgraded, so with yarn you'll get this error when upgrading any package that has peer deps.
@ljharb It looks like you're right, I was able to fix this by using yarn upgrade for all of our existing eslint plugins - yarn upgrade eslint-plugin-import eslint-plugin-filenames-suffix eslint-plugin-jsx-a11y eslint-plugin-babel eslint-plugin-react eslint-plugin-standard, then delete the yarn.lock file and rerun yarn. I'm not sure if this is a bug with yarn or just a limitation that we need to account for. ¯\_(ツ)_/¯
At the moment, a mix of the two, I think.
Most helpful comment
Nevermind, I restarted Atom and this error went away...