Two-way bind to a const or computed value
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.
What it detects
bind:prop needs a writable target. Binding to a const is a Svelte compile error, and binding to a `$:` computed value is a logic bug because the derived value recomputes and overwrites whatever the bind wrote. Bind to a plain `let` and derive the other value from it instead.
Why it matters
A bind: needs a writable target. Binding to a value declared with const is a Svelte compile error because a const cannot be reassigned. Binding to a `$:` computed value compiles but is a logic bug: the derived value recomputes from its inputs and overwrites whatever the two-way bind wrote, so the field appears to reset itself.
How to fix it
Bind to a plain let variable, and derive any dependent value from it with `$:` rather than binding to the derived value. For example bind:value={name} where let name = "", and separately $: greeting = "Hi " + name. If you were binding to a const, change it to let, or bind to a real state variable and compute the const from it.
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