简体   繁体   English

为单个规则运行 eslint

[英]Run eslint for a single rule

How do I run eslint for a single rule?如何为单个规则运行eslint I want to fix one at a time on a code base with many errors.我想在有很多错误的代码库上一次修复一个。

Something like: eslint --rule no-def path/类似于: eslint --rule no-def path/

eslint --no-eslintrc --rule "no-undef: 2" path

请参阅--rule--no-eslintrc

If you want to use your eslintrc file to keep your configuration (parser, plugin settings, etc), you can use eslint-nibble with the --rule=no-undef flag.如果你想使用你的 eslintrc 文件来保存你的配置(解析器、插件设置等),你可以使用带有--rule=no-undef标志的eslint- --rule=no-undef This will respect your normal configuration, but only show you errors from that rule.这将尊重您的正常配置,但只会向您显示该规则中的错误。

Disclaimer: I'm the creator of eslint-nibble.免责声明:我是 eslint-nibble 的创造者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM