sveltejs / prettier-plugin-svelte

Format your svelte components using prettier.
MIT License
735 stars 95 forks source link

Support for Svelte 5 experimental {#snippet} syntax? #411

Closed danawoodman closed 8 months ago

danawoodman commented 10 months ago

Just curious if support for {#snippet} will be added in a @next labelled branch so we can try out Svelte 5 and still get formatting.

Right now as soon as I use a snippet, Prettier stops working in the file

dummdidumm commented 10 months ago

Can you provide a reproduction? The plugin's latest version already supports snippets

colelawrence commented 10 months ago

~I noticed that the svelte-5 test in this repo was also marked with a suffix of .skip. Was that intentional?~ https://github.com/sveltejs/prettier-plugin-svelte/blob/master/test/printer/samples/snippet.html.skip

Edit: See my comment below. I was mistaken. This would be skipped because we're still using Svelte 4 for devDependencies in this repo, and this prettier plugin relies on the peer dependency svelte compiler.

colelawrence commented 10 months ago

I see now that it does work. I had two versions of svelte in my repo, so it was failing at the part using Svelte 4's parser.