✅ The extends: 'plugin:ember/strict-gjs' or extends: 'plugin:ember/strict-gts' property in a configuration file enables this rule.
Require a key attribute in {{#each}} loops for better rendering performance and to avoid rendering issues.
This rule enforces using a key attribute in {{#each}} blocks to help Ember track items efficiently.
Examples of incorrect code for this rule:
<template>
{{#each items as |item|}}
<div>{{item.name}}</div>
{{/each}}
</template>Examples of correct code for this rule:
<template>
{{#each items key="id" as |item|}}
<div>{{item.name}}</div>
{{/each}}
</template>
<template>
{{#each items key="@index" as |item|}}
<div>{{item.name}}</div>
{{/each}}
</template>- strictGjs: true
- strictGts: true