eslint shows the spent times of rules if the environment variable TIMING is set.
For example:
$ 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%
See also the official docs on Profile Rule Performance.
Answer from mysticatea on Stack Overflowjavascript - Which eslint rules in my config are slow? - Stack Overflow
typescript - How to speed up eslint on project with tons of files? - Stack Overflow
slow linting performance with high CPU usage
Speed up ESLint
Videos
eslint shows the spent times of rules if the environment variable TIMING is set.
For example:
$ 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%
See also the official docs on Profile Rule Performance.
I found that removing slow rules didn't really help that much, as loading eslint and parsing files takes a while.
It is possible to use the --cache option of eslint (docs) to speed things up substantially.
When using eslint to "lint-as-you-type" in various editors, installing eslint_d allows running eslint as a daemon, and saves the node loading time.
On the project I'm currently working on, combining both eslint_d and --cache brought the linting time from 4+ seconds to 0.17!
Hi all, I've been using neovim for about 6 months now and really enjoy it, but my only issue is that I find the feedback loop from eslint is incredibly slow - in the seconds range, compared to the same project in vscode. I assume this is an implementation issue on my end, but I have no idea what to do to resolve this.
I've also noticed that in projects that use the typescript-eslint parser, sometimes node processes just go through the roof.. which again is not an issue with whatever vscode is doing.
Thanks in advance for the help!!
So I'm pretty new to Typescript, but at work I'm trying to help TS adoption on our very large project. However, currently the typechecking analysis through Webstorm and VSCode is very slow and I believe its hurting adoption and the general perception of Typescript due to how slow typchecking can be. Often it can it can up to a minute or longer for either IDE to perform its typechecking to show an error or update a reference. I'm wondering if its due to how we have our project set up?
For ease of introduction, my coworkers set up Typescript to rely more on the IDE and the Typescript Language Service, use ESLint (typescript-eslint plugin) instead of TSLint and disable emitting/compilation.
Here's our tsconfig. Do we have something setup incorrectly? Or is TS generally just slow on large projects? Thanks
{
"compilerOptions": {
"target": "esnext",
"moduleResolution": "node",
"allowJs": true,
"noEmit": true,
"strict": true,
"module": "esnext",
"isolatedModules": false,
"esModuleInterop": true,
"resolveJsonModule": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"preserveConstEnums": true,
"removeComments": false,
"lib": ["esnext", "dom"],
"baseUrl": ".",
"paths": {
// ...
},
"experimentalDecorators": true,
"disableSizeLimit": true,
"jsx": "react",
"types": ["node", "jest"]
},
"include": [
"src/**/*",
],
"exclude": [
"dist/**/*",
"node_modules/**/*",
]
}