-
-
Notifications
You must be signed in to change notification settings - Fork 721
feat(linter): add react/forbid-dom-props rule #14365
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
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.
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 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
camc314
left a comment
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.
Thank you!
This PR adds
react/forbid-dom-propsrule, issue #1022