# svelte/no-useless-children-snippet

disallow explicit children snippet where it’s not needed

  • βš™οΈ This rule is included in "plugin:svelte/recommended".

# πŸ“– Rule Details

Any content inside component tags that is not a snippet declaration implicitly becomes part of the children snippet. Thus, declaring the children snippet explicitly is only necessary when the snippet has parameters.

<script>  /* eslint svelte/no-useless-children-snippet: "error" */   import { Foo } from './Foo.svelte'; </script>  <!-- βœ“ GOOD --> <Foo>  {#snippet bar()}  Hello  {/snippet} </Foo>  <Foo>  {#snippet children(val)}  Hello {val}  {/snippet} </Foo>  <Foo>Hello</Foo>  <!-- βœ— BAD --> <Foo>  
Found an unnecessary children snippet. (svelte/no-useless-children-snippet)
{#snippet children()}
Hello {/snippet} </Foo>

# πŸ”§ Options

Nothing.

# πŸš€ Version

This rule was introduced in eslint-plugin-svelte v3.0.0-next.9

# πŸ” Implementation