I'm getting this error with a globally installed eslint and Node 7 Nightly on Windows:
The error message in Atom editor:
Error: Failed to load plugin import: Cannot find module 'es6-set' Referenced from: C:\Users\Lanti\AppData\Roaming\npm\node_modules\eslint-config-airbnb\node_modules\eslint-config-airbnb-base\index.js Referenced from: airbnb Referenced from: C:\www\node\lantosistvan.eslintrc.js
Error: Failed to load plugin import: Cannot find module 'es6-set'
Referenced from: C:\Users\Lanti\AppData\Roaming\npm\node_modules\eslint-config-airbnb\node_modules\eslint-config-airbnb-base\index.js
Referenced from: airbnb
Referenced from: C:\www\node\lantosistvan\.eslintrc.js
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (C:\Users\Lanti\AppData\Roaming\npm\node_modules\eslint-plugin-import\lib\rules\max-dependencies.js:5:15)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
Node version: v7.0.0-test2016100609987d242b
NPM version: 3.10.8
I think these are related issues:
https://github.com/airbnb/javascript/issues/465
https://github.com/walmartlabs/eslint-config-defaults/issues/43
https://github.com/benmosher/eslint-plugin-import/issues/611
https://github.com/benmosher/eslint-plugin-import/issues/604
Looks like installing es6-set globally solving it. Missing dependency?
I'd recommend not installing anything globally - if you do, I think you'd need to manually cd into the global location where eslint-config-airbnb is installed, and manually install the peer dependencies.
It's best to install everything locally, only.
Is there a way to install it locally and use eslint for Atom, Sublime Text? I'm using the airbnb standard for color linting in GUI editors.
Yes, both of those editors can be configured to look in node_modules/.bin.
If I understand, I should install airbnb standard inside one of my projects, then I set the eslint executible path to this local install in Sublime Text / Atom?
Maybe I just create a new node project which contains all of the eslint, airbnb standard related stuff and I set this eslint's path to the GUI editors? Kinda like a .dotfiles repo, but only for local installs for GUI editor dependencies?
Yes, I'm suggesting the former.
You could certainly do the latter but I don't think any project _should_ be linted unless a developer who cloned the project on another machine can run npm install and be able to lint it the same as you - in other words, literally anything you run on your project should be in package.json.
@DJviolin assuming you are using the linter-eslint package in Atom, you shouldn't need to set anything. It should detect the locations for you if you have everything installed locally in the project.
The latter actually won't work inside Atom, at least not without modifying the code of the package. What you are describing is similar to a global install of eslint which isn't recommended, but is supported.
Please continue to discuss if needed.