Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 550 Bytes

File metadata and controls

31 lines (21 loc) · 550 Bytes

no-duplicate-key

This rule is imported and adapted from https://github.com/jsx-eslint/eslint-plugin-react.

🔧 Rule Source

Rule Details

Duplicate key values among sibling elements cause React to mis-handle list updates. This rule warns when sibling keys are duplicated.

❌ Incorrect

return [
  <Item key="a" />,
  <Item key="a" />,
]

✅ Correct

return [
  <Item key="a" />,
  <Item key="b" />,
]

Options

This rule has no configuration options.