Prettier-vscode: not formatting huge js file onSave

Created on 5 Jul 2018  路  4Comments  路  Source: prettier/prettier-vscode

Hi,

I set up my vscode install to format javascript files on save. I set "prettier.eslintIntegration":true. I create a js file, paste some code from another project, hit save and the code is formatted as expected. I wanted to see, what the plugin can do, so I took a jquery.js-file that's about 10.000 lines long. It is not formatted on save.
Is there a known limit?
I select "format document" ALT + SHIFT + F and it works fine. There seems to be an issue when formatting onSave.

I did npm i -D prettier-eslint so I believe local/recent versions of prettier and eslint are being used.

locked

Most helpful comment

From the settings:

// Format on save timeout. Specifies a time limit in milliseconds for formatOnSave-commands. Commands taking longer than the specified timeout will be cancelled.
"editor.formatOnSaveTimeout": 750

Prettier can take a some seconds in some case to format. Even more when you had eslint...

All 4 comments

From the settings:

// Format on save timeout. Specifies a time limit in milliseconds for formatOnSave-commands. Commands taking longer than the specified timeout will be cancelled.
"editor.formatOnSaveTimeout": 750

Prettier can take a some seconds in some case to format. Even more when you had eslint...

Oversaw that setting. Thanks alot!

This really had me stumped thanks. I changed it to 2000 just in case. Hopefully that's okay. Should probably split the file up. :smile:

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings