# noSvelteLegacyConst

Rule `biome/noSvelteLegacyConst`. Disallow legacy Svelte `{@const}` tags.

- Source: biome
- Technologies: Svelte
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1941 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/noSvelteLegacyConst` | no | no | group nursery, since 2.5.8 | [docs](https://biomejs.dev/linter/rules/no-svelte-legacy-const/) |

## Code examples

### Incorrect: the rule reports this

```svelte
{#each boxes as box}
    {@const area = box.width * box.height}
    <p>{area}</p>
{/each}
```

### Correct: the rule accepts this

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

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noSvelteLegacyConst": "error"
      }
    }
  }
}
```

## Related rules

- [biome/noSvelteIgnoredUnsubscribe](https://lintradar.dev/rules/biome/noSvelteIgnoredUnsubscribe.md): Disallow ignoring the function returned by a store's `subscribe()` method.
- [biome/noTailwindArbitraryValue](https://lintradar.dev/rules/biome/noTailwindArbitraryValue.md): Disallow arbitrary values in Tailwind CSS utility classes.
- [biome/noSolidDestructuredProps](https://lintradar.dev/rules/biome/noSolidDestructuredProps.md): Disallow destructuring props inside JSX components in Solid projects.
- [biome/noTailwindRawColors](https://lintradar.dev/rules/biome/noTailwindRawColors.md): Disallow Tailwind CSS utility classes that use raw palette colors.
- [biome/noShortTimeValues](https://lintradar.dev/rules/biome/noShortTimeValues.md): Disallow animation and transition times that are shorter than a configured minimum.
- [biome/noTailwindRestrictedClasses](https://lintradar.dev/rules/biome/noTailwindRestrictedClasses.md): Disallow Tailwind CSS classes and variants that your project doesn't allow.

---

Web page: https://lintradar.dev/rules/biome/noSvelteLegacyConst. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
