Unused Svelte events
What an unused-svelte-event finding of fallow dead-code means, why it matters and how to fix it.
What it reports
A Svelte component dispatches a createEventDispatcher event whose name is listened to nowhere in the project.
Dead code explains how fallow finds it.
Why it matters
The component dispatches an event that no parent handles, so the action that the event reports has no effect. Readers assume that some parent reacts to it.
Example
Child.svelte calls const dispatch = createEventDispatcher(); dispatch('dead'), but no parent listens for it (no <Child on:dead> anywhere in the project).
Fix
Remove the dispatched event, or listen for it on the component (<Child on:dead={...}> or forward it via <Child on:dead>). If the event is dispatched reflectively (a dynamic name) or is part of a deliberately-stable public component API, suppress the line with // fallow-ignore-next-line unused-svelte-event.
Facts
| Fact | Value |
|---|---|
| Issue type | unused-svelte-event |
| Rule id in SARIF output | fallow/unused-svelte-event |
| Command | fallow dead-code |
| Default severity | warn |
Config key in rules | unused-svelte-events |
| Filter option | --unused-svelte-events |
| Suppression comment | // fallow-ignore-next-line unused-svelte-event |
Fixable with fallow fix | No |
| Opt-in | No |