Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
What version of ESLint are you using?
9.10.0
What version of eslint-plugin-svelte
are you using?
2.44.0
What did you do?
Does not work with any configuration, you can try the following example in the current docs.
Code example
Copy the following into the rules docs
<script>
/* eslint svelte/indent: "error" */
function click() {}
</script>
<!-- ✓ GOOD -->
<button
type="button"
on:click={click}
class="my-button primally"
>
CLICK ME!
</button>
<!-- ✗ BAD -->
<button
type="button"
on:click={click}
class="my-button primally"
>
{#snippet example()}
<div>Some code</div>
{/snippet}
{#if true}
<div>Some other code</div>
{/if}
</button>
What did you expect to happen?
To have the indent of the {/snippet}
and it's content (basically the div
), be properly indented, as the if
clause:
Expected result
<script>
/* eslint svelte/indent: "error" */
function click() {}
</script>
<!-- ✓ GOOD -->
<button
type="button"
on:click={click}
class="my-button primally"
>
CLICK ME!
</button>
<!-- ✗ BAD -->
<button
type="button"
on:click={click}
class="my-button primally"
>
{#snippet example()}
<div>Some code</div>
{/snippet}
{#if true}
<div>Some other code</div>
{/if}
</button>
What actually happened?
The {/snippet}
indent is not correctly updated
Results
<script>
/* eslint svelte/indent: "error" */
function click() {}
</script>
<!-- ✓ GOOD -->
<button
type="button"
on:click={click}
class="my-button primally"
>
CLICK ME!
</button>
<!-- ✗ BAD -->
<button
type="button"
on:click={click}
class="my-button primally"
>
{#snippet example()}
<div>Some code</div>
{/snippet}
{#if true}
<div>Some other code</div>
{/if}
</button>
Link to GitHub Repo with Minimal Reproducible Example
Additional comments
No response
Metadata
Metadata
Assignees
Labels
No labels