Dmytro Filipenko
Dmytro Filipenko

Reputation: 941

ESLint in WebStorm

Has anybody encountered the problem ESLint not loading in WebStorm? I'm trying to specify a path /usr/local/bin/eslint, /usr/local/bin,

Every time I got this message:

Screenshot of the shown error message "Please specify ESLint package correctly"

or no such directory message.

Upvotes: 36

Views: 75622

Answers (4)

owaisdotio
owaisdotio

Reputation: 101

I was facing this issue and I installed the ES Lint again through the command, npm install --save-dev eslint

I had settings to automatic but still the popup was there, so I restarted the IDE, and the popup was gone.

Upvotes: 0

Devner
Devner

Reputation: 7235

Following are the steps you need to get it working on Windows 10:

  1. Open command prompt and navigate to your project root.

  2. Run the following command: npm install eslint --save-dev

  3. Once ESLint finishes installing in the above step, navigate through the following menus in Webstorm: File > Settings.... Click on Settings...

  4. In the Settings screen that shows up, in the top-left hand corner, there is a Search box. Type eslint in it.

  5. That will show you the 'ESLint' settings for this project. Now tick the checkbox that says "Enable". Make sure that the Node interpreter: has the right value. In my case, it was C:\Program Files\nodejs\node.exe

  6. Just below the Node interpreter: setting, there is a setting called ESLint package:. If you have correctly installed the ESLint package as I mentioned in Step 2 above, this setting will be auto-populated to show the current path of ESLint package from your project's node_modules folder. In my case, the value of this setting was: D:\www\gdp\node_modules\eslint (gdp is my project root folder)

  7. Click on Apply and OK buttons respectively.

  8. Restart Webstorm. If you have successfully completed all the steps, you will not see the prompt to enter the ESLint again.

  9. Enjoy!!!

Upvotes: 9

Lukas Liesis
Lukas Liesis

Reputation: 26393

OS X El Capitan

I've installed npm & node with brew. It's easy to keep stuff up to date with brew.

  1. brew install node

then installed eslint globally with npm

  1. npm i eslint -g

and here is my working config:

  1. /usr/local/bin/node /usr/local/lib/node_modules/eslint

I add .eslintrc file with eslint rules in project's root folder.

Try using those drop-downs next to input field, webstorm gives path w/o any typing.

Upvotes: 12

Donnie Thomas
Donnie Thomas

Reputation: 4038

You need to point that field to the actual ESLint script. This would usually be the place where you've installed the ESLint npm package or command-line tool.

ESLint Package Location

Upvotes: 34

Related Questions