fix: remove react/no-multi-comp alias to enable strict oxlint version - #1640
Draft
skoshx wants to merge 1 commit into
Draft
fix: remove react/no-multi-comp alias to enable strict oxlint version#1640skoshx wants to merge 1 commit into
skoshx wants to merge 1 commit into
Conversation
Removes the alias from `react/no-multi-comp` to `react-doctor/no-multi-comp`. This allows users who want strict 'one component per file' enforcement to access oxlint's `react/no-multi-comp` rule via `.oxlintrc.json`, while preserving the lenient `react-doctor/no-multi-comp` behavior for users who explicitly configure it. The react-doctor version is intentionally more permissive, with corpus-informed exemptions for: - Files with ≤2 components (main + helper) - Feature modules (1-2 exports + private helpers) - Barrel files (mostly-exported components) Added tests: - Unit tests for alias removal in rule-key-aliases.test.ts - Regression test for issue #1639 in no-multi-comp.regressions.test.ts - Documentation in no-multi-comp.ts explaining the exemptions and how to use oxlint's strict version Closes #1639 Co-authored-by: Skosh <skoshx@users.noreply.github.com>
commit: |
Contributor
Interactive terminal E2ETerminal Control verified the built CLI at
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the alias from
react/no-multi-comptoreact-doctor/no-multi-compto resolve issue #1639.Problem
The alias
react/no-multi-comp→react-doctor/no-multi-compcreated an expectation mismatch:react/no-multi-comp: Strict "one component per file" rule (fires on 2+ components)react-doctor/no-multi-comp: Lenient with corpus-informed exemptions (fires on 3+ components with specific exceptions)Users writing
react/no-multi-compin their config expected oxlint's strict behavior but got react-doctor's lenient version instead. There was no way to access oxlint's strict version through react-doctor config.Solution
Remove the alias so users can explicitly choose:
react-doctor/no-multi-compin config.oxlintrc.jsonwith:{ "plugins": ["react"], "rules": {"react/no-multi-comp": "error"} }Why the lenient version exists
React Doctor's
no-multi-compwas intentionally designed with exemptions based on corpus analysis to avoid false positives in real-world patterns:These exemptions are well-tested (see regression tests) and reflect production React code patterns.
Migration
Users who previously configured
react/no-multi-compand relied on the lenient behavior should update their config to explicitly usereact-doctor/no-multi-comp. The rule continues to run by default with unchanged behavior.Testing
Closes
Closes #1639