Autofix ESLint Issue on Webstrom 2016

Currently, me and my team are working on Javascript application using NodeJS and ReactJS. We use ESLint to use a coding standard with AirBnB config. We’re satisfied with it so far.

I’m using Webstorm 2016 for code. Great features. But there’s something missing on it. On Visual Studio Code and Atom, we can fix ESLint issue on save. But not it Webstorm 2016. It’s still a requested feature based on this Stackoverflow answer.

However, Webstorm provides a plugin called File Watcher. This plugin will “watch” changes on our code and will run a specific task if there’s a change. For more information, please refer here. I’m using File Watcher to auto fix ESLint issue on our code. This is how I setup a File Watcher:

  1. Install a File Watcher plugin. You can find it on Preferences > Plugins > Search for “File Watchers". Check it and click Apply button. You need to restart Webstorm.
Preferences > Plugins > Search for “File Watchers”

2. Go to Preferences > Tools > File Watchers. Create a new File Watcher by clicking the + button. Choose custom template.

3. Change the File Type to Javascript.

4. Adjust your Scope to your project directory or whatever folder you want to include.

5. Add eslint binary path on the Watcher Settings > Program. If you install ESlint locally (per project), you can find eslint on node_modules/bin and the path will looks like this


If you install ESLint globally (and/or use nvm), you can check eslint path by execute which eslint on terminal. Since I’m using nvm, my eslint path looks like this


6. Add --fix $FileName$ to Watcher Settings > Arguments.

7. Click on the Watcher Settings > Other Options to expand hidden options and add $FileDir to Watcher Settings > Other Options > Working Directory.

8. Uncheck the Immediate file synchronization.


Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade