[英]How to selectively enable eslint rules from eslint-config-airbnb
[英]Which eslint rules in my config are slow?
我有一个包含大约100条规则的配置,并且在我的项目上使用所有这些规则运行eslint大约需要10秒。 我想确定最慢的规则并消除其中的一些规则。 我该怎么做呢? 是否有任何用于eslint的分析器工具?
如果设置了环境变量TIMING
则eslint显示规则的花费时间。 例如:
$ TIMING=1 eslint lib
Rule | Time (ms) | Relative
:----------------------------|----------:|--------:
valid-jsdoc | 203.798 | 6.7%
camelcase | 142.146 | 4.6%
no-unmodified-loop-condition | 136.811 | 4.5%
indent | 127.138 | 4.2%
no-undefined | 124.525 | 4.1%
keyword-spacing | 85.397 | 2.8%
space-in-parens | 76.179 | 2.5%
no-this-before-super | 72.317 | 2.4%
no-implied-eval | 69.945 | 2.3%
space-infix-ops | 57.128 | 1.9%
另请参阅有关Per-rule性能的官方文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.