Skip to content

Files

Latest commit

 

History

History
40 lines (26 loc) · 857 Bytes

require-each-key.md

File metadata and controls

40 lines (26 loc) · 857 Bytes

Pattern: Missing use of keyed {#each} block

Issue: -

Description

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.

📚 Further Reading

🚀 Version

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

🔍 Implementation