Skip to content

Conversation

@baevm
Copy link
Contributor

@baevm baevm commented Oct 5, 2025

This PR adds react/forbid-dom-props rule, issue #1022

@baevm baevm requested a review from camc314 as a code owner October 5, 2025 17:29
Copilot AI review requested due to automatic review settings October 5, 2025 17:29
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 5, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added the A-linter Area - Linter label Oct 5, 2025
@baevm baevm changed the title feat (linter): add react/forbid-dom-props rule feat(linter): add react/forbid-dom-props rule Oct 5, 2025
@github-actions github-actions bot added the C-enhancement Category - New feature or request label Oct 5, 2025
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 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_props rule 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-hq
Copy link

codspeed-hq bot commented Oct 5, 2025

CodSpeed Performance Report

Merging #14365 will not alter performance

Comparing baevm:react/forbid-dom-props (d8d2090) with main (831974f)

Summary

✅ 4 untouched
⏩ 33 skipped1

Footnotes

  1. 33 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314 camc314 self-assigned this Oct 6, 2025
@camc314 camc314 force-pushed the react/forbid-dom-props branch from fff87a2 to d8d2090 Compare October 22, 2025 11:16
Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@camc314 camc314 merged commit dd1fdd4 into oxc-project:main Oct 22, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants