Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.14 KB

require-each-key.md

File metadata and controls

54 lines (36 loc) · 1.14 KB
pageClass sidebarDepth title description since
rule-details
0
svelte/require-each-key
require keyed `{#each}` block
v2.28.0

svelte/require-each-key

require keyed {#each} block

📖 Rule Details

This rule reports {#each} block without key

<script>
  /* eslint svelte/require-each-key: "error" */
</script>

<!-- ✓ GOOD -->
{#each things as thing (thing.id)}
  <Thing name={thing.name} />
{/each}

<!-- ✗ BAD -->
{#each things as thing}
  <Thing name={thing.name} />
{/each}

🔧 Options

Nothing.

👫 Related Rules

📚 Further Reading

🚀 Version

This rule was introduced in eslint-plugin-svelte v2.28.0

🔍 Implementation