no-dupe-use-directives
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: warnhtml/eslint-plugin-svelte-recommended
What it does
Section titled “What it does”Reports two use: directives of one element that have the same action and the same parameter.
Why it matters
Section titled “Why it matters”The action runs twice on the element, which is rarely meant and doubles its set-up and clean-up.
To fix, remove one of them.
Example
Section titled “Example”...<svelte:head><title>t</title></svelte:head><input on:click={a} on:click={a} on:click|once={c} use:tip use:tip use:other style:color="a" style:color|important={b}>......<svelte:head><title>t</title></svelte:head><input on:click={a} on:click={a} on:click|once={c} use:tip use:tip use:other style:color="a" style:color|important={b}>...Configuration
Section titled “Configuration”angular: lint: rules: no-dupe-use-directives: warn # off, warn (default), errorhtml: lint: rules: no-dupe-use-directives: warn # off, warn (default), errorsvelte: lint: rules: no-dupe-use-directives: warn # off, warn (default), errorvue: lint: rules: no-dupe-use-directives: warn # off, warn (default), errorEnabled by the presets: html/eslint-plugin-svelte-recommended.
Suppress one line with sudsy-disable-next-line no-dupe-use-directives 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-dupe-use-directives |
full |