eslint-plugin icon indicating copy to clipboard operation
eslint-plugin copied to clipboard

Support for locally installed eslint

Open wnr opened this issue 7 years ago • 2 comments

Hi,

I have multiple projects that have eslint installed locally through npm. I can't figure out how to configure this plugin to handle that. Is it possible to have a non-global configuration? Similar plugins for other editors such as Atom scans the project node_modules directory.

Thanks

wnr avatar Jul 03 '17 13:07 wnr

You can set the path to local copy or global, as described in the readme:

Set the path to the eslint bin file. should point to node_modules/eslint/bin/eslint.js if you installed locally or /usr/local/bin/eslint if you installed globally. For Windows: install eslint globally and point to the eslint cmd file like, e.g. C:\Users<username>\AppData\Roaming\npm\eslint.cmd

idok avatar Jul 13 '17 16:07 idok

In my experience, the local .eslintrc.js is not respected. I have specified the full path of the file in Configuration File textbox in WebStrorm's preferences dialog (rather than default Automatic Search. My .eslintrc.js file has a rule

// Allow ++ or -- operatorsin for loops
'no-plusplus': ["error", { "allowForLoopAfterthoughts": true }],

But I am still getting the ESLint errors for this case.

kashiif avatar Aug 08 '17 18:08 kashiif