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 Overflow
🌐
TypeScript ESlint
typescript-eslint.io › troubleshooting › typed-linting › performance
Performance | typescript-eslint
Using Project References -which ... to speed up type checking on larger projects. If none of the above work, you can try adjusting the --max-semi-space-size of Node. Increasing the max size of a semi-space can improve performance at the cost of more memory consumption. You can read more about setting space size in Node.js here. You can enable the setting by prepending your ESLint command ...
🌐
Medium
vmoh.medium.com › maximizing-eslint-performance-in-typescript-projects-ae12271fd370
Maximizing ESLint Performance in TypeScript Projects | by Vahid Mohammadi | Medium
March 29, 2024 - Your ESLint command should only lint `.ts` files included in the tsconfig.json files. If you lint files that aren’t included, typescript-eslint (used to) create a TS project for each file to lint it! That’ll take a lot of time!!
🌐
Marvinh
marvinh.dev › blog › speeding-up-javascript-ecosystem-part-3
Speeding up the JavaScript ecosystem - eslint
The two third party plugins that always seem to pop up and take a considerable time to execute are eslint-plugin-import and eslint-plugin-node. Whenever one or both of these plugins were active, it really showed in the profiling data. Both cause heavy filesystem traffic as they try to resolve a bunch of modules, but don't cache the results. We wrote a lot about that in part 2 of this series, so I won't go into more detail on that. We'll start with the TypeScript conversion happening at the beginning.
🌐
Duncanleung
duncanleung.com › why typescript-eslint performance is slow
Why typescript-eslint Performance is Slow – Duncan Leung
Use the --cache flag when running eslint: eslint --cache \*\*/\_.ts. Store the info about processed files in order to only operate on the changed ones. There is also a whole article on TypeScript performance which recommends: Set up tsconfig.json with the include property to specify only input folders in a project with TypeScript files that should be compiled.
🌐
Stack Overflow
stackoverflow.com › questions › 77240364 › how-to-speed-up-eslint-on-project-with-tons-of-files
typescript - How to speed up eslint on project with tons of files? - Stack Overflow
Also you can try using .eslintignore files: https://eslint.org/docs/latest/use/configure/ignore ... Sign up to request clarification or add additional context in comments.
🌐
GitHub
github.com › typescript-eslint › typescript-eslint › issues › 389
Poor performance on some projects · Issue #389 · typescript-eslint/typescript-eslint
March 29, 2019 - I'm opening a new issue since the other (#243) is closed and might not have visibility, but please close if not appropriate. We are trying to use typescript-eslint on a pretty large project with 1000+ files. The CLI is very slow (see sta...
Author   jrparish
🌐
GitHub
github.com › typescript-eslint › typescript-eslint › issues › 1140
slow linting performance with high CPU usage · Issue #1140 · typescript-eslint/typescript-eslint
October 25, 2019 - By inspecting the process, I could find that the initiator is the eslint extension, so I believe the root problem is the same. I also ran with TIMING=1 and disabled the most resource intensive rules (>10%) with no significant result. I also tried downgrading @typescript-eslint/eslint-plugin and @typescript-eslint/parser from 2.5.0 to 2.3.0 and upgrading to 2.5.1-alpha.3 to no result.
Author   mpgon
Find elsewhere
🌐
Reddit
reddit.com › r/neovim › eslint with some typescript rules is incredibly slow with null_ls compared to vscode
r/neovim on Reddit: eslint with some typescript rules is incredibly slow with null_ls compared to vscode
July 31, 2023 -

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!!

🌐
Mitchell A. Gordon
mitchgordon.me › software › 2021 › 06 › 28 › why-vscode-eslint-fast.html
Why Is VSCode Typescript Linting So Damn Fast? | Mitchell A. Gordon
June 28, 2021 - This lines up with my experience, since doing · $ cd my_proj $ time tsc real 0m4.968s user 0m8.181s sys 0m0.689s · takes around 8 seconds. So that’s 8 seconds to compile the project, and < 1 second to run the actual linter rules. And as expected, removing parserOptions.project speeds up ...
🌐
YouTube
youtube.com › tejas kumar
Why TypeScript ESLint is so slow with Josh Goldberg - YouTube
This is a clip from the ConTejas Code Podcast. Watch the full episode: https://youtu.be/ieKgqmcdiXEChapters 00:00:00 - Introduction and ESLint Performance Is...
Published   September 13, 2024
Views   284
🌐
Lightrun
lightrun.com › answers › vuejs-vue-eslint-parser-very-slow-with-typescript-eslint-parser-and-project
Very slow with typescript-eslint parser and `project`
Angular project with eslint is super slow - Stack Overflow · The underlying issue is still the overhead of the TypeScript compiler ... In my case the parserOptions.project was configured to .Read more > ... Unfortunately, enabling this option is known to be very slow since ... And as expected, removing parserOptions.project speeds up eslint to ...Read more >
🌐
Branclon
branclon.com › blog › speeding-up-linting
Brandon Pereira's Portfolio - How to speed up linting locally and in CI
We decided to use ESLint’s cache to speed it up. ... This will cache the results of the linting, and only lint the files that have changed since the last run. As a result, the first time you run this, it will take a while to run. However, subsequent runs will be much faster. We use Typescript to typecheck our code.
🌐
GitHub
github.com › typescript-eslint › typescript-eslint › issues › 4735
Bug: eslint is running slow when giant files such as typescript.js are included · Issue #4735 · typescript-eslint/typescript-eslint
December 14, 2021 - There are no linting errors in these files (eslint passes successfully), so again, why is "fixed text" even being generated? I am willing to submit a pull request for this issue. Will post separately (GitHub is complaining about the content length). ... externalThis issue is with another package, not typescript-eslint itselfThis issue is with another package, not typescript-eslint itselfperformanceIssues regarding performanceIssues regarding performance
Author   kaiyoma
🌐
GitHub
github.com › eslint › eslint › issues › 16962
Speed up ESLint · Issue #16962 · eslint/eslint
March 5, 2023 - This is an issue to define tasks to improve ESLint performance per the recommendations from the "Speeding up the JavaScript ecosystem - eslint" blog post: https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-3/ I was able to ex...
Author   mdjermanovic
🌐
GitHub
github.com › typescript-eslint › typescript-eslint › issues › 2878
Massive Slowdown · Issue #2878 · typescript-eslint/typescript-eslint
December 15, 2020 - [ X ] I have tried restarting my IDE and the issue persists. [ X ] I have updated to the latest version of the packages. I have read the FAQ and my problem is not listed. Repro Hi there, so I know this is listed in the FAQs but the level...
Author   Goldziher
🌐
Medium
medium.com › scripting-bits › speeding-up-eslint-bad7a52d1d20
Speeding Up ESLint. ESLint is pretty slow, especially after… | by Vinson Chuong | Scripting Bits | Medium
July 29, 2020 - So, this means that if I keep a process running with the linter warmed up, I can speed up linting by 10x, at least for a small project. Most tools interact with ESLint (and it’s derivatives) through its CLI.
🌐
DEV Community
dev.to › malykhinvi › eslint-vs-performance-5592
Eslint vs Performance - DEV Community
April 3, 2021 - But I would add: start with ten the longest-running rules if your goal is to speed up linting.
🌐
Reddit
reddit.com › r/javascript › [askjs] eslint replacement or making it fast
r/javascript on Reddit: [AskJS] EsLint replacement or making it fast
November 12, 2024 -

For context:

I have a Isomorphic JS project that is considered that uses nodeJS/React, the app uses single EsLint Configuration for both ends, the App uses so many linting rules, both plugins and custom ones written inside the team, the problem we have now is pre-commit checks are taking forever to finish (roughly 30 seconds)

We tried to remove all linting rules that we don't and the pre-commit checks are taking now around 10s

better but still bad, we tried also to look through alternatives like https://oxc.rs/ but the problem with OXC we could not reuse our existent rules, we are ok to rewrite our custom rules in any other language or any form that even if the new form does not use esTree for AST.

And to make EsLint faster we made some hacks including replace some rules with tsconfig flag checks like noUnusedLocals.

The question:

Do you have any suggestion for me to make the linting faster?
I am certainly we are running out of ideas.

UPDATE:

I tried Biome, my problem with migrating into Biome is it does not have support to our custom rules, since they don't support plugins yet, https://github.com/biomejs/biome/discussions/1649

Here are our custom rules we use:

  1. Throw Warnings when specific deprecated dependancies being imported

  2. Fixer function that replaces function call with a inversified class

  3. Warn whenever localstorage being used directly instead of using a react-hook made internally

  4. Checks if try catch does not have error cause

  5. Warning when a dev imports code from another monorepo

🌐
Medium
medium.com › inato › using-typescript-to-build-custom-eslint-rules-faster-53ad1c9dee2b
Using TypeScript to build custom ESLint rules faster | by Vincent Francois | inato | Medium
July 28, 2023 - We’ll need to install the package @typescript-eslint/rule-tester to import the tester utility and we also need to install the @typescript-eslint/parser node module so ESLint is able to parse the TypeScript code we’ll write in the test cases.