-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add jsx-key-before-spread
, closes #1093, closes #1087
#1105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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 "jsx-key-before-spread" that enforces the order of JSX attributes so that the key attribute appears before any spread attributes.
- Added a new rule implementation in packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.ts.
- Updated various configuration files and plugin registration to include the new rule.
- Provided tests and documentation for the rule.
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/plugins/eslint-plugin/src/configs/x.ts | Added rule mapping for "@eslint-react/jsx-key-before-spread". |
packages/plugins/eslint-plugin/src/configs/all.ts | Added rule mapping for "@eslint-react/jsx-key-before-spread". |
packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.ts | Implemented the new rule to enforce key order relative to spread attributes. |
packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.spec.ts | Added tests validating the new rule's behavior. |
packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.md | Created documentation for the new rule. |
packages/plugins/eslint-plugin-react-x/src/plugin.ts | Registered the new rule with the plugin. |
packages/plugins/eslint-plugin-react-x/src/configs/recommended.ts | Updated recommended config to include the new rule. |
Files not reviewed (2)
- apps/website/content/docs/rules/meta.json: Language not supported
- apps/website/content/docs/rules/overview.mdx: Language not supported
packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.ts
Outdated
Show resolved
Hide resolved
30d6406
to
cb2f1d0
Compare
There was a problem hiding this 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 the new ESLint rule "jsx-key-before-spread" to enforce that the key attribute appears before any spread attributes in JSX elements. Key changes include updates to configuration files, the implementation of the new rule along with its tests and documentation, and exporting the rule in the plugin module.
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/plugins/eslint-plugin/src/configs/x.ts | Added a configuration entry for "@eslint-react/jsx-key-before-spread". |
packages/plugins/eslint-plugin/src/configs/all.ts | Added a configuration entry for "@eslint-react/jsx-key-before-spread". |
packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.ts | New rule implementation enforcing key before spread in JSX elements. |
packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.spec.ts | Added test cases for the new rule. |
packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.md | New documentation for the rule. |
packages/plugins/eslint-plugin-react-x/src/plugin.ts | Modified to export the new "jsx-key-before-spread" rule. |
packages/plugins/eslint-plugin-react-x/src/configs/recommended.ts | Updated the recommended config to include the new rule. |
Files not reviewed (2)
- apps/website/content/docs/rules/meta.json: Language not supported
- apps/website/content/docs/rules/overview.mdx: Language not supported
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___
)Other information