idok / eslint-plugin

ESLint plugin for intellij
http://plugins.jetbrains.com/plugin/7494
MIT License
151 stars 18 forks source link

Support for locally installed eslint #65

Open wnr opened 7 years ago

wnr commented 7 years ago

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

idok commented 7 years ago

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\\AppData\Roaming\npm\eslint.cmd

kashiif commented 7 years ago

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.