Auto format doesn't work with {@render }
Closed this issue · 2 comments
zoaha commented
Describe the bug
seems auto-format doesn't work whenever there's a {anything here}
declaration
Reproduction
<script>
let { children } = $props();
</script>
<div class="outer">
<div class="inner">
<div class="container">
{@render children()}
</div>
</div>
</div>
^will not auto format, comment out the line <!-- {@render children()} -->
allows it to work again
Expected behaviour
expect auto format, in the case of the example, extra lines between the divs should be removed
System Info
- OS: Windows
- IDE: VSCode
Which package is the issue about?
No response
Additional Information, eg. Screenshots
No response
zoaha commented
jasonlyu123 commented
Duplicate of #2338. Svelte 5 currently require a workspace version of prettier-plugin-svelte and a prettier config file.
https://github.com/sveltejs/kit/blob/main/packages/create-svelte/shared/%2Bprettier/.prettierrc
As for the second issue, in SveltKit's route files, the snippet children
props may have auto-typing, but it needs explicit typing in other components.
<script>
/**
* @type {{children: import('svelte').Snippet}}
*/
const {
children
} = $props();
</script>