Open
Description
Given the following invalid code (invalid because an {:else} block comes before a {:else if} block):
{#if condition === 0}
A
{:else}
REMOVED
{:else if condition === 1}
ELIF
{/if}
Running prettier with prettier-plugin-svelte
enabled on this file removes the section marked REMOVED.
This can lead to code being deleted if a file is saved and auto-formatted mid-way through refactoring.
I would expect that formatting a Svelte file with syntax errors had no effect, which is the behaviour for JavaScript.
Metadata
Metadata
Assignees
Labels
No labels