Skip to content

fix(rules/no-array-index-key, rules/no-missing-key): improve key detection#1867

Merged
Rel1cx merged 1 commit into
mainfrom
refactor/key-rules
Jun 10, 2026
Merged

fix(rules/no-array-index-key, rules/no-missing-key): improve key detection#1867
Rel1cx merged 1 commit into
mainfrom
refactor/key-rules

Conversation

@Rel1cx

@Rel1cx Rel1cx commented Jun 10, 2026

Copy link
Copy Markdown
Owner
  • no-array-index-key: replace name-based index tracking with scope-based resolution, fixing shadowed identifier false positives; also detect Number() coercion, ??/||/ternary fallbacks, and string-literal 'key' props in createElement calls
  • no-missing-key: track nested Children.toArray with a depth counter, support flatMap, and check conditional/logical branches in array literals without double-reporting nested arrays

Update "[ ]" to "[x]" to check a box

What kind of change does this PR introduce?

Check at least one. If you are introducing a new binding, you must reference an issue where this binding has been proposed, discussed and approved by the maintainers.

  • Bugfix
  • Feature
  • Perf
  • Docs
  • Test
  • Chore
  • Enhancement
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

If yes, please describe the impact and migration path for existing applications in an attached issue.

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • I have added a convincing reason for adding this feature, if necessary

Other information

… detection

- no-array-index-key: replace name-based index tracking with scope-based
  resolution, fixing shadowed identifier false positives; also detect
  Number() coercion, ??/||/ternary fallbacks, and string-literal 'key'
  props in createElement calls
- no-missing-key: track nested Children.toArray with a depth counter,
  support flatMap, and check conditional/logical branches in array
  literals without double-reporting nested arrays
@Rel1cx Rel1cx marked this pull request as ready for review June 10, 2026 22:54
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
eslint-react Building Building Preview, Comment Jun 10, 2026 10:54pm

@Rel1cx Rel1cx merged commit 325914d into main Jun 10, 2026
11 of 12 checks passed
@Rel1cx Rel1cx deleted the refactor/key-rules branch June 10, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant