How do I run eslint
for a single rule? I want to fix one at a time on a code base with many errors.
Something like: eslint --rule no-def path/
ESLint comes with a large number of built-in rules and you can add more rules through plugins. You can modify which rules your project uses either using configuration comments or configuration files. To change a rule setting, you must set the rule ID equal to one of these values: "off" or 0 - turn the rule off.
Keep in mind that we have over 200 rules, and that is daunting both for end users and the ESLint team (who has to maintain them).
Set up ESLint to autofix files To enable running eslint --fix on save for the current project, go to Preferences / Settings | Languages and Frameworks | JavaScript | Code Quality Tools | ESLint and tick the Run eslint --fix on save checkbox. By default, WebStorm will run ESLint to autofix . js, . ts, .
eslint --no-eslintrc --rule "no-undef: 2" path
See --rule
and --no-eslintrc
.
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