Skip to content

Refactor no-implicit-key rule to use type checking - #1466

Merged
Rel1cx merged 7 commits into
mainfrom
no-implicit-key-2
Feb 5, 2026
Merged

Refactor no-implicit-key rule to use type checking#1466
Rel1cx merged 7 commits into
mainfrom
no-implicit-key-2

Conversation

@Rel1cx

@Rel1cx Rel1cx commented Feb 5, 2026

Copy link
Copy Markdown
Owner

What kind of change does this PR introduce?

  • 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?

  • 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

@Rel1cx
Rel1cx requested a review from Copilot February 5, 2026 12:38
@vercel

vercel Bot commented Feb 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
eslint-react Ready Ready Preview, Comment Feb 5, 2026 0:52am

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the no-implicit-key rule to use TypeScript type checking instead of AST-only analysis. The rule now examines spread attributes using TypeScript's type system to detect when they implicitly pass a 'key' prop to components.

Changes:

  • Reimplemented the rule logic to use type checking via getConstrainedTypeAtLocation and unionConstituents
  • Added the rule to type-checked configurations (recommended-type-checked and strict-type-checked)
  • Added the rule to disable-type-checked configuration
  • Updated documentation across multiple files to reflect the new description and behavior
  • Changed test suite to use ruleTesterWithTypes instead of ruleTester

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/plugins/eslint-plugin-react-x/src/rules/no-implicit-key.ts Refactored rule implementation to use TypeScript type checking instead of AST analysis
packages/plugins/eslint-plugin-react-x/src/rules/no-implicit-key.spec.ts Updated tests to use type-checked test runner
packages/plugins/eslint-plugin-react-x/src/rules/no-implicit-key.mdx Updated documentation with new description and examples
packages/plugins/eslint-plugin-react-x/src/configs/recommended-type-checked.ts Added rule to recommended-type-checked configuration
packages/plugins/eslint-plugin-react-x/src/configs/strict-type-checked.ts Added rule to strict-type-checked configuration
packages/plugins/eslint-plugin/src/configs/recommended-type-checked.ts Added rule to recommended-type-checked configuration
packages/plugins/eslint-plugin/src/configs/strict-type-checked.ts Added rule to strict-type-checked configuration
packages/plugins/eslint-plugin/src/configs/disable-type-checked.ts Added rule to disable-type-checked configuration
packages/plugins/eslint-plugin-react-x/src/rules/no-unnecessary-key.mdx Updated cross-reference description
packages/plugins/eslint-plugin-react-x/src/rules/no-missing-key.mdx Updated cross-reference description
packages/plugins/eslint-plugin-react-x/src/rules/no-duplicate-key.mdx Updated cross-reference description
packages/plugins/eslint-plugin-react-x/src/rules/no-array-index-key.mdx Updated cross-reference description
packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.mdx Updated cross-reference description
apps/website/content/docs/rules/overview.mdx Updated rule features and presets, reformatted RSC rules table

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/plugins/eslint-plugin-react-x/src/rules/no-implicit-key.ts
Comment thread packages/plugins/eslint-plugin-react-x/src/rules/no-implicit-key.mdx Outdated
Comment thread packages/plugins/eslint-plugin-react-x/src/rules/no-implicit-key.mdx Outdated
…ey.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: REL1CX <solarflamex@hotmail.com>

Copilot AI commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

@Rel1cx I've opened a new pull request, #1467, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

@Rel1cx I've opened a new pull request, #1468, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

@Rel1cx I've opened a new pull request, #1469, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

@Rel1cx I've opened a new pull request, #1470, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
#1469)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: REL1CX <solarflamex@hotmail.com>
Copilot AI and others added 2 commits February 5, 2026 20:45
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Rel1cx <24217275+Rel1cx@users.noreply.github.com>
Co-authored-by: REL1CX <solarflamex@hotmail.com>
…#1468)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: REL1CX <solarflamex@hotmail.com>
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.

3 participants