shorthand-directive
What it does
Section titled “What it does”Reports bind:name={name}, class:name={name} and style:name={name} where the shorthand (bind:name) would do. The fix writes the shorthand.
Why it matters
Section titled “Why it matters”The name is written twice for nothing, and one form keeps the components uniform.
To fix, write bind:name; the fix does it.
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}><input bind:value={value} class:big>...<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><input bind:value class:big>...<C>{#snippet children(x)}{x}{/snippet}</C>...Configuration
Section titled “Configuration”angular: lint: rules: shorthand-directive: warn # off (default), warn, errorhtml: lint: rules: shorthand-directive: warn # off (default), warn, errorsvelte: lint: rules: shorthand-directive: warn # off (default), warn, errorvue: lint: rules: shorthand-directive: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line shorthand-directive 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 | shorthand-directive |
full |