prettier-plugin-svelte
prettier-plugin-svelte copied to clipboard
`svelteStrictMode` still causes Svelte components to self-close
I tried both of these options to stop that behaviour :
"svelte.plugin.svelte.format.config.svelteStrictMode": true,
"svelte.plugin.html.completions.enable": false
With "svelte.plugin.svelte.format.config.svelteStrictMode": true, <div></div> does not become <div /> when saving.
But <Container></Container> will still become <Container />
I tried to disable other html formatting but couldn't find any option that prevents self-closing of Svelte components
There's no option currently to stop this behavior, components without content are always self closed.
Alright thanks! It's probably a niche case, but I usually create multiple components and paste them before filling them one by one and right now I had to go back and re-open the self closing each time.
I have a lot of elements that I like to keep open instead of being self closed. I think an option to disable self closing should be added in. Some of my components are designed to have slot elements and its annoying that some of my elements automatically self close.
In version 3, components will be left as the user wrote them and not format one into the other.