Will It Vibe logoWill It Vibe?
SVELTE-010Low severity-4 points

Array mutation does not trigger reactivity

Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

Svelte reactivity is driven by assignment, so a bare arr.push(), .splice(), or .sort() mutates the array in place without telling Svelte, and the UI does not update. Reassign instead, for example arr = [...arr, item]. Heuristic: a purely local array that is never rendered does not need this.

Why it matters

Svelte tracks changes through assignment, not through mutation. Calling arr.push(), arr.splice(), or arr.sort() changes the array contents but never assigns to arr, so Svelte does not know anything changed and the UI keeps showing the old list. This is one of the most common Svelte reactivity surprises. It is a heuristic: a purely local array that is never rendered does not need reassignment.

How to fix it

Follow the mutation with an assignment, or build a new value: arr = [...arr, item] to append, arr = arr.filter(...) to remove, arr = [...arr].sort(...) to sort. The pattern arr.push(item); arr = arr; also works because the trailing assignment triggers reactivity, but building a new array is clearer. Apply the same rule to object mutations that need to be reactive.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Code Quality & Syntax checks