Skip to content
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

ESLint stuck on formatting large files #1797

Open
dennemark opened this issue Mar 5, 2024 · 3 comments
Open

ESLint stuck on formatting large files #1797

dennemark opened this issue Mar 5, 2024 · 3 comments
Labels
info-needed Issue requires more information from poster

Comments

@dennemark
Copy link

Hi,

I am surprised I could not find this issue here. Maybe I have used the wrong search words though.

Everytime I am saving a large file, i.e. an imported geojson, and I press save, ESLint tries to format it, but it takes ages. So I choose the option Save without Formatting and the file is being saved as is.
However, ESLint seems to be still stuck in this process, since now saving even small files leads to a never ending Saving process. It is visible via the popup appearing in VSCode.

When trying to restart ESLint, it complains:

[Error - 11:10:55] Restarting client failed
Error: Stopping the server timed out
	at XXX/.vscode/extensions/dbaeumer.vscode-eslint-2.4.4/client/out/extension.js:1:105150
	at async b.restart (XXX/.vscode/extensions/dbaeumer.vscode-eslint-2.4.4/client/out/extension.js:1:270303)

It seems I can only continue properly, after restarting VSCode. But I also feel it also works after waiting for a while. It seems ESLint is still formatting the large file, although the file was already saved without formatting, and therefore other Saving processes wait for ESLint to finish this one.

I automatically run eslint on save:

 "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.sortImports": "explicit"
  },

Is there a way to stop currently running ESLint processes or stop them when the file has been saved another time?

@dbaeumer
Copy link
Member

dbaeumer commented Mar 5, 2024

This is usually caused by a slow ESLint rule and here are steps on how to diagnose and resolve / work around this: #1344

Even if we kill the server without tweaking what happens on save you will run into the same problem again on the next file.

@dbaeumer
Copy link
Member

dbaeumer commented Mar 5, 2024

Let me know how it goes.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Mar 5, 2024
@dennemark
Copy link
Author

Going to have a look at this as soon as I run into this issue again! The explanation seems really helpful. Keep you posted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants