簡體   English   中英

如何調試 eslint 規則?

[英]How can I debug eslint rules?

我想調試 eslint 規則以進行性能優化。 有什么方法可以使用瀏覽器/命令行/工具對其進行調試?

在命令行上運行時可以使用TIMING=1

$ TIMING=1 eslint lib

Rule                    | Time (ms) | Relative
:-----------------------|----------:|--------:
no-multi-spaces         |    52.472 |     6.1%
camelcase               |    48.684 |     5.7%
no-irregular-whitespace |    43.847 |     5.1%
valid-jsdoc             |    40.346 |     4.7%
handle-callback-err     |    39.153 |     4.6%
space-infix-ops         |    35.444 |     4.1%
no-undefined            |    25.693 |     3.0%
no-shadow               |    22.759 |     2.7%
no-empty-class          |    21.976 |     2.6%
semi                    |    19.359 |     2.3%

文檔: https://eslint.org/docs/1.0.0/developer-guide/working-with-rules#per-rule-performance

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM