-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Extension 'Prettier - Code formatter' is configured as formatter but it cannot format 'Svelte'-files #16093
Comments
We are having the same problem. Reverting back to prettier 3.1.0 did fix the problem, thanks for the info @qupig . |
It is strange that there is a difference in behavior between 3.1 and 3.2, we need to look into it! |
I can add more context, hoping it can help.
|
This is indeed strange. I have a project that uses |
prettier/prettier-vscode#3335 will solve this. |
That's good news ! |
Still an issue despite prettier/prettier-vscode#3335 being merged. |
I know that this issue is related to
prettier-plugin-svelte
,Svelte for VS Code
,prettier-vscode
.But the issue is posted in this repo because this is where the damage is directly caused.
After my repeated testing, this issue occurred when
prettier
was updated to 3.1.1, and also exists in 3.2.0 or the latest 3.2.5 version.In other words, the last working version was prettier v3.1.0
Specific issue manifestations:
Upgrading to
prettier
3.1.1 or newer versions with only theprettier-vscode
plug-in installed will cause theFormat Document
menu to disappear in svelte files.If the
Svelte for VS Code
plug-in is installed at the same time, the error message in the title will be prompted after clicking theFormat Document
menu.It looks like the issue is that after
prettier
was updated to 3.1.1, thesvelte
support provided byprettier-plugin-svelte
was not fed back to theprettier-vscode
plugin while the config file remained unchanged.vscode settings
.prettierrc.json
It will work fine via the prettier command line or specifying the vscode formatter as
Svelte for VS Code
, but it has nothing to do with this issue.The text was updated successfully, but these errors were encountered: