Closed rayl0 closed 2 months ago
I don't know what I was doing, but the problem was me not using prettier-plugin-svelte at all
I had the same problem, the svelte create app doesn't generate a prettier config file, so I had to make my own. I thought it was working because of my prettier config inside vscode settings.
I have the same problem on Svelte 5 - when using snippets, the plugin "Svelte for VS Code" stops formatting code in the file .svelte,
The project was created according to the instructions on the official Svelte website:
npm create vite@latest my-svelte-project -- --template svelte
Considering that SvelteKit users do not have this problem, I suspect that it can be solved with the help of some additional settings.
That project doesn't come with prettier installed, you need setup prettier yourself according to https://github.com/sveltejs/prettier-plugin-svelte?tab=readme-ov-file#setup
That project doesn't come with prettier installed, you need setup prettier yourself according to https://github.com/sveltejs/prettier-plugin-svelte?tab=readme-ov-file#setup
According to this instruction, formatting is performed by a command from the CLI, after installing these packages, it is unclear whether formatting will work in the editor using the plugin "Svelte for VS Code"?
Thanks!
I don't know if some people are experiencing this issue or is it only me, but I am having serious headaches, I am using svelte 5, and whenever I use "Snippets", the code won't format. If I remove them, and only use slots, it works fine.