# useSvelteShorthandDirective

Rule `biome/useSvelteShorthandDirective`. Enforce the shorthand syntax for Svelte `bind:`, `class:`, and `style:` directives.

- 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: #612 by reach, #247 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/useSvelteShorthandDirective` | yes | safe | group nursery, since 2.6.0 | [docs](https://biomejs.dev/linter/rules/use-svelte-shorthand-directive/) |

## Code examples

### Incorrect: the rule reports this

```svelte
<input bind:value={value} />
```

```svelte
<div class:active={active}></div>
```

```svelte
<div style:color={color}></div>
```

### Correct: the rule accepts this

```svelte
<input bind:value />
<input bind:value={name} />
<div class:active></div>
<div class:active={isActive}></div>
<div style:color></div>
<div style:color="red"></div>
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useSvelteShorthandDirective": "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/useSvelteRequireEachKey](https://lintradar.dev/rules/biome/useSvelteRequireEachKey.md): Require keyed `{#each}` blocks in Svelte templates.
- [biome/useTailwindVariablesShorthand](https://lintradar.dev/rules/biome/useTailwindVariablesShorthand.md): Enforce the shorthand syntax for CSS variables in Tailwind CSS classes.
- [biome/useSvelteReactiveClasses](https://lintradar.dev/rules/biome/useSvelteReactiveClasses.md): Require the reactive classes from `svelte/reactivity` instead of built-in objects that are modified.
- [biome/useTanstackQueryExhaustiveDependencies](https://lintradar.dev/rules/biome/useTanstackQueryExhaustiveDependencies.md): Require query keys to include every value that the query function uses.
- [biome/useSvelteKitRuneImports](https://lintradar.dev/rules/biome/useSvelteKitRuneImports.md): Require importing SvelteKit's app state from `$app/state` instead of `$app/stores`.
- [biome/useTanstackQueryInfiniteQueryPropertyOrder](https://lintradar.dev/rules/biome/useTanstackQueryInfiniteQueryPropertyOrder.md): Enforce a consistent property order in the options of TanStack Query infinite query functions.

---

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