I'm using WebStorm 2017.3 and ESLint.
I'm wondering: is there a way to customize ESLint errors highlighting so I will be able to distinguish the WebStorm's errors (there is no closing bracket) and ESLint 'errors' (there should be a space before the bracket)?
Currently, I can not distinguish critical typos and 'advices' of ESLint.
Open the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Languages & Frameworks | JavaScript | Code Quality Tools | ESLint, and select the Run eslint --fix on save checkbox.
There are three ways that ESLint fix can be run: eslint --fix. eslint --fix-dry-run. eslint --fix --fix-type.
WebStorm integrates with ESLint and other most popular JavaScript code linters that detect problems in your code without executing it. When installed and enabled, a linter activates automatically every time you open a JavaScript file, reports detected errors and warnings, and suggests quick-fixes where possible.
In File | Settings | Editor | Inspections, select ESLint
Uncheck in Options: use rule severity from the configuration file
From the Severity dropdown, choose the desired severity level, or select Edit severities and set up your own severity level with desired highlighting
'Custom' severity highlighting is not supported for ESLint - WEB-25697. Level 1 issues (https://eslint.org/docs/user-guide/configuring#configuring-rules) are highlighted as warnings ( Settings | Editor | Color Scheme | General | Errors and Warnings | Warning), Level 2 - as errors (Settings | Editor | Color Scheme | General | Errors and Warnings | Error)
Update: since 2018.3, you can override severity levels from the linter's config by unchecking Use rule severity from the configuration file in Preferences | Editor | Inspections | ESLint. Please note that this way all rules enabled in the config will be highlighted the same way, without the distinction between errors and warnings. See this comment: https://youtrack.jetbrains.com/issue/WEB-25697#focus=streamItem-27-3090927.0-0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With