首页 > 解决方案 > 如何为启动时间过长的 create-react-app 启用 eslint 缓存?

问题描述

我想知道为什么我的项目需要太长时间,我已经检查了一些关于它的主题,现在我认为这可能eslint cachereact-scripts.

这是结果TIMING=1 eslint .

Rule                                     | Time (ms) | Relative
:----------------------------------------|----------:|--------:
react/no-direct-mutation-state           |  1818.923 |    24.9%
react/no-typos                           |   812.661 |    11.1%
react/require-render-return              |   765.499 |    10.5%
unused-imports/no-unused-imports         |   592.197 |     8.1%
testing-library/await-async-utils        |   233.464 |     3.2%
no-whitespace-before-property            |   199.900 |     2.7%
testing-library/no-container             |   154.535 |     2.1%
testing-library/no-debug                 |   145.567 |     2.0%
testing-library/no-promise-in-fire-event |   123.937 |     1.7%
testing-library/await-async-query        |   120.638 |     1.7%

我想知道为什么 yarn start,不会生成eslintcahce.

我该如何解决这个问题?

标签: javascriptreactjseslintcreate-react-appreact-scripts

解决方案


推荐阅读