feat(linter): add react/forbid-dom-props rule#14365
feat(linter): add react/forbid-dom-props rule#14365camc314 merged 4 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/forbid-dom-props rule for the linter, which allows preventing the use of specific props on DOM elements in React JSX. The rule is configurable to forbid certain props either globally or only on specific DOM elements, with optional custom error messages.
Key changes:
- Added the new
forbid_dom_propsrule implementation with comprehensive configuration support - Added comprehensive test cases covering various configuration scenarios
- Integrated the rule into the linter's module system
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/oxc_linter/src/rules/react/forbid_dom_props.rs | Main implementation of the forbid_dom_props rule with configuration parsing and linting logic |
| crates/oxc_linter/src/rules.rs | Added module declaration and rule registration for forbid_dom_props |
| crates/oxc_linter/src/snapshots/react_forbid_dom_props.snap | Test snapshot file containing expected error outputs |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Performance ReportMerging #14365 will not alter performanceComparing Summary
Footnotes
|
fff87a2 to
d8d2090
Compare
This PR adds
react/forbid-dom-propsrule, issue #1022