I know you can define rules in an .eslintrc
file, but what if I just want to run eslint
and check for one specific rule?
E.g. $ eslint helpme.js --rule some-important-rule
You can turn off every rule and run only with basic syntax validation or mix and match the bundled rules and your custom rules to fit the needs of your project. There are two primary ways to configure ESLint: Configuration Comments - use JavaScript comments to embed configuration information directly into a file.
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.
If you want to use your .eslintrc file to keep your configuration (parser, plugin settings, etc), you can use eslint-nibble with the --rule=some-important-rule
flag. This will respect your normal configuration, but only show you errors from that rule. There are some other flags as well like --no-interactive
if you want to run this in something like a CI environment.
Disclaimer: I'm the creator of eslint-nibble.
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