Skip to content

noSvelteLegacyConst

biome.json
{
"linter": {
"rules": {
"nursery": {
"noSvelteLegacyConst": "error"
}
}
}
}

Disallow legacy Svelte {@const} tags.

Declaration tags provide the current syntax for deriving values in Svelte markup (available since Svelte 5.56).

{#each boxes as box}
{@const area = box.width * box.height}
<p>{area}</p>
{/each}
{#each boxes as box}
{const area = $derived(box.width * box.height)}
<p>{area}</p>
{/each}