npm / prettier-plugin-svelte
prettier-plugin-svelte
What changed in prettier-plugin-svelte 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-24.
7 breaking1 behavior and defaults1 tooling5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initprettier-plugin-svelte 49 changes
Breaking changes 3
Svelte 5 is now required.
The svelteBracketNewLine option has been removed.
The svelteStrictMode option has been removed.
Tooling 1
Adds support for Svelte 5 declaration tags.
Fixes and other changes 5
Preserves nested rest patterns in
{#each}destructuring.Prevents dropping
<script>or<style>content when a closing tag has whitespace.Preserves whitespace inside
<textarea>, whose content is whitespace-sensitive like<pre>.Fixes printing of @const.
Trailing
<!-- #endregion -->comments are kept below svelte:options, scripts, and styles.
prettier-plugin-svelte 35 changes
Breaking changes 4
Requires Node.js version 14 or higher.
Requires Prettier version 3, which may require adjustments to your configuration file.
svelteAllowShorthandnow takes precedence oversvelteStrictMode; set it tofalseto restore the v2 behavior.The deprecated
svelteSortOrderoptions have been removed.
Behavior and default changes 1
Empty elements and components preserve the user's self-closing or paired-tag notation; with
svelteStrictMode, elements must use paired tags while components are left alone.