shorthand-attribute
What it does
Section titled “What it does”Reports name={name} where the shorthand {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 {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}>...<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: shorthand-attribute: warn # off (default), warn, errorhtml: lint: rules: shorthand-attribute: warn # off (default), warn, errorsvelte: lint: rules: shorthand-attribute: warn # off (default), warn, errorvue: lint: rules: shorthand-attribute: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line shorthand-attribute 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-attribute |
full |