feat(linter): added rule for react/jsx-max-depth#17279
feat(linter): added rule for react/jsx-max-depth#17279camc314 merged 13 commits intooxc-project:mainfrom
react/jsx-max-depth#17279Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new linter rule react/jsx-max-depth that enforces a maximum nesting depth for JSX elements and fragments to improve code readability and maintainability.
Key changes:
- Implemented the
jsx-max-depthrule with configurable maximum depth (default: 2) - Added comprehensive test coverage with both passing and failing test cases
- Registered the rule in the linter's rule registry
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/oxc_linter/src/rules/react/jsx_max_depth.rs |
New rule implementation with configuration, depth calculation logic, and test cases |
crates/oxc_linter/src/rules.rs |
Module declaration and rule registration |
crates/oxc_linter/src/generated/rule_runner_impls.rs |
Generated RuleRunner implementation for the new rule |
crates/oxc_linter/src/snapshots/react_jsx_max_depth.snap |
Test snapshot showing expected diagnostic output |
crates/oxc_codegen/tests/integration/snapshots/stacktrace_is_correct.snap |
Unrelated: Node.js version update (v24.10.0 → v24.12.0) |
apps/oxlint/src/snapshots/fixtures__tsgolint_rule_options_--type-aware@oxlint.snap |
Unrelated: Test infrastructure changes |
apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware@oxlint.snap |
Unrelated: Test infrastructure changes |
apps/oxlint/fixtures/tsgolint_fix/fix.ts |
Unrelated: Test fixture update |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #17279 will not alter performanceComparing Summary
Footnotes
|
51e3ec9 to
d108541
Compare
340d13b to
73fe070
Compare
|
@camc314 thanks always! i think i've done all tests, now ready to review. |
camc314
left a comment
There was a problem hiding this comment.
The performance regression here is massive - we'll need to get it down to a much more reasonable level before it can be merged
related: #1022
added react/jsx-max-depth rule to oxlinter!