Determining when to run ESLint

Is it possible to configure PHPStorm to perform the lint:

  • As you change file (the default)
  • On File Open
  • On File Save
  • On Keymapping Press

Right now, it lints as I type (which is nice, but can be a bit process intensive. I'd rather it lint on saving of the file instead.

1
3 comments

ESLint is run as inspection - and there is no way to inspect files on Save, Open, etc.

You can disable online inspections for a file using Hector icon in the lower right corner: open your file in editor, click the Hector icon and then move the slider to change the Highlighting level to Syntax. See https://www.jetbrains.com/help/webstorm/2016.3/changing-highlighting-level-for-the-current-file.html. You can then use Code/Inspect Code to run inspections explicitly and view the results in Inspection Results tool window

 

Or, you can disable the ESLint integration completely and set up ESLint as a file watcher (https://www.jetbrains.com/help/webstorm/2016.3/file-watchers.html), for example - file watchers can be run on explicit Save

0
Avatar
Permanently deleted user

Thanks for the Hector Icon/Explicit Code Insepection Keymapping workaround Elena.

Can I assume that for the File Watcher solution, the captured response from the linter won't be integrated into the UI of the Editor itself?

0

you are right - when using a watcher, the output will only be shown in console. You can try setting up output filters (https://www.jetbrains.com/help/webstorm/2016.3/output-filters-dialog.html) to turn console messages into hyperlinks

0

Please sign in to leave a comment.