no-useless-children-snippet
Angular templatesHTMLVue / SvelteVue / Sveltesuspiciousno fixdefault: warnhtml/eslint-plugin-svelte-recommended
What it does
Section titled “What it does”Reports a {#snippet children()} with no parameters inside a component.
Why it matters
Section titled “Why it matters”It is the same as writing the content in the component, and the longer form hides that.
To fix, write the content without the snippet.
Example
Section titled “Example”...<C>{#snippet children()}hi{/snippet}</C><C>{#snippet children(x)}{x}{/snippet}</C>......<C>{#snippet children()}hi{/snippet}</C><C>{#snippet children(x)}{x}{/snippet}</C>...Configuration
Section titled “Configuration”angular: lint: rules: no-useless-children-snippet: warn # off, warn (default), errorhtml: lint: rules: no-useless-children-snippet: warn # off, warn (default), errorsvelte: lint: rules: no-useless-children-snippet: warn # off, warn (default), errorvue: lint: rules: no-useless-children-snippet: warn # off, warn (default), errorEnabled by the presets: html/eslint-plugin-svelte-recommended.
Suppress one line with sudsy-disable-next-line no-useless-children-snippet 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-useless-children-snippet |
full |