feat(linter): add react/jsx-props-no-spreading rule#15769
feat(linter): add react/jsx-props-no-spreading rule#15769camc314 merged 7 commits intooxc-project:mainfrom
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
There was a problem hiding this comment.
Pull Request Overview
This PR implements the react/jsx-props-no-spreading ESLint rule, which disallows JSX prop spreading to improve code readability and maintainability.
- Adds new linting rule with configurable options for HTML tags, custom components, explicit spreads, and exceptions
- Includes comprehensive test coverage with 10 passing and 13 failing test cases
- Properly integrates the rule into the linter's rule registry and runner system
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| crates/oxc_linter/src/rules/react/jsx_props_no_spreading.rs | Core rule implementation with configuration parsing, tag classification logic, and comprehensive test suite |
| crates/oxc_linter/src/rules.rs | Adds module declaration and registers the new rule in the lint rules list |
| crates/oxc_linter/src/generated/rule_runner_impls.rs | Implements RuleRunner trait to integrate the rule with JSXSpreadAttribute AST node type |
| crates/oxc_linter/src/snapshots/react_jsx_props_no_spreading.snap | Snapshot file containing expected diagnostic output for test cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #15769 will not alter performanceComparing Summary
Footnotes
|
afedc41 to
7893585
Compare
99877b0 to
62bd6ee
Compare
added `react/jsx-props-no-spreading` rule, issue oxc-project#1022 [rule doc](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md) [rule source](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/jsx-props-no-spreading.js) --------- Co-authored-by: Cameron Clark <[email protected]>
added
react/jsx-props-no-spreadingrule, issue #1022rule doc
rule source