Skip to content

Conversation

@Rel1cx
Copy link
Owner

@Rel1cx Rel1cx commented Aug 26, 2025

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • Test
  • 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

@vercel
Copy link

vercel bot commented Aug 26, 2025

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

Project Deployment Preview Comments Updated (UTC)
eslint-react Ready Ready Preview Comment Aug 26, 2025 8:42pm

@Rel1cx Rel1cx marked this pull request as ready for review August 26, 2025 20:39
@Rel1cx Rel1cx requested a review from Copilot August 26, 2025 20:39
Copy link
Contributor

Copilot AI left a comment

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 introduces a new ESLint rule no-unnecessary-key that prevents unnecessary key props on JSX elements when rendering lists. The rule identifies cases where keys are placed on child elements instead of the top-level element returned from array maps.

  • Adds the new rule implementation with proper detection logic for unnecessary keys in map callbacks
  • Includes comprehensive test coverage for various scenarios including nested elements and fragments
  • Provides detailed documentation with examples of correct and incorrect usage

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/plugins/eslint-plugin/src/configs/all.ts Adds the new rule to the "all" configuration
packages/plugins/eslint-plugin/README.md Updates branch references in contributing guidelines
packages/plugins/eslint-plugin-react-x/src/rules/no-unnecessary-key.ts Implements the core rule logic for detecting unnecessary keys
packages/plugins/eslint-plugin-react-x/src/rules/no-unnecessary-key.spec.ts Provides comprehensive test cases for the rule
packages/plugins/eslint-plugin-react-x/src/rules/no-unnecessary-key.mdx Documents the rule with examples and usage guidelines
packages/plugins/eslint-plugin-react-x/src/plugin.ts Registers the new rule in the plugin
packages/plugins/eslint-plugin-react-x/src/configs/recommended.ts Removes commented-out rules (cleanup)
packages/plugins/eslint-plugin-react-x/src/configs/recommended-type-checked.ts Removes commented-out rule (cleanup)
apps/website/content/docs/rules/overview.mdx Adds rule to documentation table
apps/website/content/docs/rules/meta.json Includes rule in metadata

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Rel1cx Rel1cx merged commit e967d43 into 2.0.0 Aug 26, 2025
10 checks passed
@Rel1cx Rel1cx deleted the no-unnecessary-key branch August 26, 2025 20:45
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.

2 participants