-
Notifications
You must be signed in to change notification settings - Fork 342
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
Saving files with eslint code action is really slow #1538
Comments
First of all, you're using the setting to auto-fix all (both linting and non-ESLint related) problems when saving a file. If you only want to auto-fix ESLint problems, try using:
Another optimization is to set Lines 406 to 419 in 4b92c12
Alternatively, you can also try explicitly listing the linting rules that you want to auto-fix with Lines 420 to 433 in 4b92c12
|
I tried |
The slowdown is usually caused by specific Eslint rules and unfortunately there is in most of the times nothing the extension itself can do about it. The recommended way to address this is to:
If none of the rules is slow can you please provide us with a GitHub repository we can clone that demos the slowness. |
I have the same problem I guess it may be caused by a combination of:
|
ESlint trace
|
Honestly, being able to see ESlint badge in the bottom bar saying "linting (pass 4)" atfer 2s lag would be good enough solution to one half of a problem It would easily solve the "why is ESLint does not work", by showing user that the linter is actually working, and that the problem is on the user's side (too many rules, slow rules, etc) |
Adding such a status is actually a good idea. I capture it here: #1542 |
Found out why it is slow in my case, we recently added |
so I guess this issue is not relevant here, but maybe on https://github.com/typescript-eslint/typescript-eslint, WDYT @dbaeumer @MariaSolOs ? |
@salamaashoush I do agree that this doesn't sound like an issue with this extension, but do note that |
@MariaSolOs is right. There are two kinds of eslint problems flaged by typescript-eslint:
|
I will close the issue since there is little, I can do to fix this besides the rule customizations I already offer. |
I was having the same issue, and just solved it with configuring // specifying `eslint.workingDirectories` is required to make vscode-eslint work properly with yarn workspaces (monorepo)
// From the docs: If executing ESLint in the terminal requires you to change the working directory in the terminal into a sub folder then it is usually necessary to tweak this setting
// read more: https://github.com/microsoft/vscode-eslint/blob/24d2ac45b2fe1b8cc8639038b724ba48610da8e2/README.md?plain=1#L238
"eslint.workingDirectories": [{ "pattern": "./packages/*/" }], |
Try adding this line to your setttings.json
|
Type: Performance Issue
when I add eslint code action on saving, saving files becomes really slow
I ran the Bisect and found that the problem comes from eslint extension
here are my eslint configs
Extension version: 2.2.6
VS Code version: Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075, 2022-10-12T22:16:30.254Z)
OS version: Darwin x64 22.1.0
Modes:
Sandboxed: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Process Info
Workspace Info
A/B Experiments
The text was updated successfully, but these errors were encountered: