-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Bug: no-unsafe-argument takes several seconds to analyze very small repo #5495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Have you checked out our FAQ on slow linting? ESLint perf timing is a bit misleading because it times things naively. TS types are computed lazily - which means the first rule that runs and accesses type information will be the one that gets "hit" with the cost of calculating them. Subsequent rules can then access the same types for free because they hit the cache. This can be illustrated by turning the no-unsafe-argument rule off - you'll notice that a different type-aware rule will have its attributed runtime increase in its stead as it takes on the type calculation. |
Thanks for the quick response. I have read the FAQ, but I don't think the caveats mentioned there apply here:
You are correct on the misleading timing though. Disabling the no-unsafe-arguments does not solve the problem it just shifts the linting time to the next rule. |
The FAQ links to this doc which also outlines the performance implication of using type-aware linting https://typescript-eslint.io/docs/linting/typed-linting#how-is-performance In a nutshell - slower linting is expected and unavoidable. |
Before You File a Bug Report Please Confirm You Have Done The Following...
Issue Description
Running eslint on the sample repo provided that just consists of two very simple files takes several seconds. Almost all of that time is spent in the no-unsafe-argument rule. The issue seems to be connected to some of the libraries installed. E.g. removing vuelidate fixes the problem.
Updating to latest vue version causes another error:
Reproduction Repository Link
https://github.com/aKzenT/eslint-problem
Repro Steps
npm install
TIMING=1 npm run eslint
Versions
@typescript-eslint/eslint-plugin
5.33.1
@typescript-eslint/parser
5.33.1
TypeScript
4.7.4
ESLint
8.22.0
node
18.4.0
The text was updated successfully, but these errors were encountered: