Click me x5 ↓
How to use Prettier with Svelte in VSCode
Hello,
That’s going to be a short one, but it’s one of these things that:
- Took longer to find than it should
- Has the answer hidden in a Readme file
In Visual Studio Code, you need to:
- Install the extension Svelte for VS Code
- Install the Prettier Svelte Plugin.
- Open your settings, then open your
settings.json
file - Set the following value:
"[svelte]": { "editor.defaultFormatter": "svelte.svelte-vscode" },
The setting was the missing piece for me. I don’t know why the Svelte Extension doesn’t set it by default.