# noSvelteUnnecessaryStateWrap

Rule `biome/noSvelteUnnecessaryStateWrap`. Disallow unnecessary `$state` wrapping of reactive classes.

- Source: biome
- Technologies: Svelte
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #554 by reach, #189 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/noSvelteUnnecessaryStateWrap` | yes | unsafe | group nursery, since 2.5.2 | [docs](https://biomejs.dev/linter/rules/no-svelte-unnecessary-state-wrap/) |

## Code examples

### Incorrect: the rule reports this

```svelte
<script>
import { SvelteMap } from "svelte/reactivity";
const map = $state(new SvelteMap());
</script>
```

### Correct: the rule accepts this

```svelte
<script>
import { SvelteMap } from "svelte/reactivity";
const map = new SvelteMap();
</script>
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [biome/noSvelteObjectInTextMustaches](https://lintradar.dev/rules/biome/noSvelteObjectInTextMustaches.md): Disallow objects, arrays, functions, and classes in Svelte text mustaches.
- [biome/noSvelteUselessDerivedBy](https://lintradar.dev/rules/biome/noSvelteUselessDerivedBy.md): Disallow `$derived.by()` when `$derived()` is sufficient.
- [biome/noSvelteInternal](https://lintradar.dev/rules/biome/noSvelteInternal.md): Disallow importing from `svelte/internal`.
- [biome/noSvgWithoutTitle](https://lintradar.dev/rules/biome/noSvgWithoutTitle.md): Enforces the usage of the `title` element for the `svg` element.
- [biome/noSvelteInspect](https://lintradar.dev/rules/biome/noSvelteInspect.md): Disallow the use of the `$inspect` rune.
- [biome/noTailwindConflictingClasses](https://lintradar.dev/rules/biome/noTailwindConflictingClasses.md): Disallow Tailwind CSS classes that set the same CSS properties on an element.

---

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