no-bind-value-on-checkable-inputs
What it does
Section titled “What it does”Reports bind:value on a checkbox or a radio button.
Why it matters
Section titled “Why it matters”The value of such an input is a fixed string, and the state is in checked, so the binding does not follow what the user does.
To fix, use bind:checked, or bind:group for a group of them.
Example
Section titled “Example”...<svelte:head><title>t</title></svelte:head>...<input type="checkbox" bind:value={v} bind:checked={v} id={id} {id} bind:group={group} class:on={on}>...<C>{#snippet children(x)}{x}{/snippet}</C>......<svelte:head><title>t</title></svelte:head>...<input type="checkbox" bind:value={v} bind:checked={v} {id} {id} bind:group class:on>...<C>{#snippet children(x)}{x}{/snippet}</C>...Configuration
Section titled “Configuration”angular: lint: rules: no-bind-value-on-checkable-inputs: warn # off (default), warn, errorhtml: lint: rules: no-bind-value-on-checkable-inputs: warn # off (default), warn, errorsvelte: lint: rules: no-bind-value-on-checkable-inputs: warn # off (default), warn, errorvue: lint: rules: no-bind-value-on-checkable-inputs: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line no-bind-value-on-checkable-inputs in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| eslint-plugin-svelte | no-bind-value-on-checkable-inputs |
full |