Open CherryDT opened 2 years ago
Observing same, so far detected no-multiple-empty-lines
rule auto-fix steadily breaks code
Also something is also breaking object constants, looking what's root
Facing the same problem, I use the template code like:
<script lang="ts">
let count = 0
const increment = () => {
count += 1
}
</script>
<button on:click={increment}>
count is {count}
</button>
With eslint --fix
becomes:
<script lang="ts">
let count = 0
const increment = () => {
count += 1;
};
</script>
<button on:click={increment;<script lang="ts">
let count = 0
const increment = () => {
count += 1
}
</script>
<button on:click={increment}>
count is {count;}
</button>
But after I add prettier-plugin-svelte
it disappears.
eslint --fix
on the fileBefore:
After:
You can see here that before the closing script tag the whole fixed part of the code got inserted a second time, instead of replacing the existing code!