Skip to content

fix: remove react/no-multi-comp alias to enable strict oxlint version - #1640

Draft
skoshx wants to merge 1 commit into
mainfrom
cursor/triage-1639-57a2
Draft

fix: remove react/no-multi-comp alias to enable strict oxlint version#1640
skoshx wants to merge 1 commit into
mainfrom
cursor/triage-1639-57a2

Conversation

@skoshx

@skoshx skoshx commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the alias from react/no-multi-comp to react-doctor/no-multi-comp to resolve issue #1639.

Problem

The alias react/no-multi-compreact-doctor/no-multi-comp created an expectation mismatch:

  • oxlint's react/no-multi-comp: Strict "one component per file" rule (fires on 2+ components)
  • react-doctor's react-doctor/no-multi-comp: Lenient with corpus-informed exemptions (fires on 3+ components with specific exceptions)

Users writing react/no-multi-comp in 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:

  1. Lenient (react-doctor version): Explicitly use react-doctor/no-multi-comp in config
  2. Strict (oxlint version): Create .oxlintrc.json with:
    {
      "plugins": ["react"],
      "rules": {"react/no-multi-comp": "error"}
    }

Why the lenient version exists

React Doctor's no-multi-comp was intentionally designed with exemptions based on corpus analysis to avoid false positives in real-world patterns:

  • Files with ≤2 components: Common "1 main + 1 helper" co-location
  • Feature modules: 1-2 public exports + N private helpers
  • Barrel files: Mostly-exported components (design systems, icon libraries)
  • All-exported files: Component primitive files (Alert + AlertTitle + AlertDescription)

These exemptions are well-tested (see regression tests) and reflect production React code patterns.

Migration

Users who previously configured react/no-multi-comp and relied on the lenient behavior should update their config to explicitly use react-doctor/no-multi-comp. The rule continues to run by default with unchanged behavior.

Testing

  • ✅ Unit tests for alias removal
  • ✅ Regression test for reported case
  • ✅ Documentation explaining exemptions and how to use oxlint's strict version
  • ✅ All existing no-multi-comp tests pass

Closes

Closes #1639

Open in Web Open in Cursor 

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>
@pkg-pr-new

pkg-pr-new Bot commented Aug 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@1640
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@1640
npm i https://pkg.pr.new/react-doctor@1640

commit: 41ace7f

@github-actions

Copy link
Copy Markdown
Contributor

Interactive terminal E2E

Terminal Control verified the built CLI at 41ace7f in a real PTY:

  • selected a project interactively and observed Scanning... before the three-second Git delay completed
  • waited for the clean result and exercised the compact report
  • opened copy context and the GitHub Actions confirmation, then cancelled safely

Download the edited MP4 and PNG evidence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react/no-multi-comp in doctor.config.ts resolves to a rule that cannot report a file which exports a component

2 participants