# useSvelteEventDispatcherTypes

Rule `biome/useSvelteEventDispatcherTypes`. Require `createEventDispatcher` calls to declare the types of their events.

- Source: biome
- Technologies: Svelte
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #607 by reach, #242 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/useSvelteEventDispatcherTypes` | yes | no | group nursery, since 2.6.4 | [docs](https://biomejs.dev/linter/rules/use-svelte-event-dispatcher-types/) |

## Code examples

### Incorrect: the rule reports this

```svelte
<script lang="ts">
import { createEventDispatcher } from "svelte";

const dispatch = createEventDispatcher();
</script>
```

### Correct: the rule accepts this

```svelte
<script lang="ts">
import { createEventDispatcher } from "svelte";

const dispatch = createEventDispatcher<{ save: string; close: null }>();
</script>
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useSvelteEventDispatcherTypes": "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/useSimpleNumberKeys](https://lintradar.dev/rules/biome/useSimpleNumberKeys.md): Disallow number literal object member names which are not base 10 or use underscore as separator.
- [biome/useSvelteKitResolve](https://lintradar.dev/rules/biome/useSvelteKitResolve.md): Require internal navigation in SvelteKit apps to use paths built with `resolve()`.
- [biome/useReactNativeValidPlatformColors](https://lintradar.dev/rules/biome/useReactNativeValidPlatformColors.md): Require `PlatformColor()` and `DynamicColorIOS()` calls to use values written directly in the call.
- [biome/useSvelteKitRuneImports](https://lintradar.dev/rules/biome/useSvelteKitRuneImports.md): Require importing SvelteKit's app state from `$app/state` instead of `$app/stores`.
- [biome/useReactNativePlatformComponents](https://lintradar.dev/rules/biome/useReactNativePlatformComponents.md): Ensure that platform-specific React Native components are only imported in files named for that platform.
- [biome/useSvelteReactiveClasses](https://lintradar.dev/rules/biome/useSvelteReactiveClasses.md): Require the reactive classes from `svelte/reactivity` instead of built-in objects that are modified.

---

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