Alert when ESLint is slow and suggest troubleshoot
danielpaz6 opened this issue · 4 comments
After installing ESLint my vscode was very slow, there was not a popup or any troubleshooting to help me solve that issue.
Some people are not as determined as me to solve that issue and might live with that if there's no significant degradation (in my case it was 6s but others complained about minutes) and might live with bad performance IDE or migrate to another one.
Eventually, I found out that the typescript.tsdk
used by VSCODE was not aligned to the typescript.tsdk
version, and I solved that by manually pointed to my ./node_modules/typescript/lib
:
#1568
My suggestion is to reflect that needed solution to the user, by any means, on VSCode code you know that I have ESLint enabled, you also know that I have node_modules with typescript, and u can also know the time it took to execute ESLINT and if it's ok or not (there's on the bottom toolbar a note)
So if these 3 conditions sufficient, you can check if the typescriot.tsdk
is aligned with the version on node_modules, because, apparently it is a requirement, and if the user needs to do that manually, I would have expected a more noticeable message or even force the user to fill it up in order to use ESLINT.
I know that this solution might couple vscode from extensions (or not, I would just guess), but even if that's the situation, ESLINT is used by tens of millions of people, and the fact that it so easy to have a DEFAULT configuration (I was just npm installed eslint and downloaded ESLint vscode extension) with super slow ESlint is just bad. So the impact of disallowing "bad" behavior has huge impact considered how many people use ESLINT and how many are probably affected by this as me.
NOTE: also need to consider multi project workspace / folder
@danielpaz6 can you share the setup in which you have experienced this. Actually, when the ESLint validation is slow it should show this in the language status indicator so that developers are aware of this. I would really like to understand, why this is not happening (see the two settings eslint.timeBudget.onValidation
and eslint.timeBudget.onFixes
, which default to 4s and 3s)
The typescriot.tsdk
setting has no effect on ESLint. ESLint, when the typescript plugin is installed, has its own TS configuration. What might be shared is the node modules if both the workspace and the ESLint typescript plugin use the same version.
Thanks @dbaeumer.
So essentially you say that the change to typescript.tsdk
path shouldn't have any impact on the performance? Because after doing so (with the suggestion #1568 (comment) that also have other thumbs up) I did actually notice a significant improvement. But maybe it could have been other things like caching and stuff like that?
Yes, setting the typescript.tsdk
has no impact on ESLint. It is only used by the TypeScript extension that ships with VS Code.