react-doctor icon indicating copy to clipboard operation
react-doctor copied to clipboard

improve v2 rasmus

Open aidenybai opened this issue 6 months ago • 3 comments

Preview release

Try this PR without waiting for an npm release:

npm i https://pkg.pr.new/react-doctor@217

Updates automatically on every push. Pin to a specific commit with react-doctor@<sha> (e.g. @840a6d5).


  • fix
  • fix
  • fix
  • fix
  • fix
  • fix
  • improve v2 rule precision based on user feedback
  • wip: parity work, score module, proxy fetch
  • improve v2 rule precision, score formula, CLI features, and parity
  • fix radix-aschild-single-child FP on JSXExpressionContainer children
  • fix
  • fix rn-no-raw-text FP on web-only directories (docusaurus, docs, storybook)
  • fix
  • fix radix-aschild-single-child FP on JSX comments
  • fix effect-needs-cleanup FP: add 'remove' to unsubscription methods
  • add test-noise tags to no-nested-component-definition and no-eval
  • extend OG_IMAGE_FILE_PATTERN for Remix-style opengraph routes
  • fix FPs found in deep issue-by-issue audit across 100 repos
  • fix client-event-listeners + js-request-idle-callback FPs
  • fix
  • fix
  • fix

[!NOTE] Medium Risk Medium risk due to a major surface-area shift (package exports, CLI rewrite, scoring/annotation behavior) that can affect consumers and CI behavior, though changes are largely additive/compat-focused with documented opt-ins.

Overview Moves react-doctor into a v2 SDK-first beta: the main export now points at the SDK, legacy diagnose() lives under react-doctor/api (with v1 error classes re-exported for compatibility), and a new react-doctor/score subpath is added while the browser-poc export is removed.

Reworks the CLI implementation and defaults: adds new changed-file modes (--unstaged, --changed), improves staged scanning by materializing needed config files safely, skips info issues in GitHub Actions annotations, and temporarily turns off codebase graph checks (dead-code/deps/architecture) by default unless explicitly enabled.

Fixes categorization/false positives by routing oxlint diagnostics through resolveOxlintDiagnosticCategory() and adjusting codebase analyzer behavior (e.g., treating new URL(..., import.meta.url) asset references and ensuring vite/nextjs config files are treated as support—not runtime—entrypoints). Adds a preview-release GitHub workflow, bumps package version to 0.2.0-beta.1, trims/adjusts dependencies, and introduces a test:regression script that packs a tarball and drives sandbox tests via the sibling react-review repo.

Reviewed by Cursor Bugbot for commit c9c3cc9191abff9d40189d71aa4a61bf307ff288. Bugbot is set up for automated code reviews on this repo. Configure here.

aidenybai avatar May 13 '26 07:05 aidenybai

✅ React Review — 87/100 (+87) · 0 ❌ errors · 557 ⚠️ warnings

Copy prompt for agent
Check if these React Review issues are valid. If so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.

Run this before and after your changes to verify the result:
npx react-doctor@latest --verbose --diff

Do not modify the react-doctor configuration unless explicitly asked.
Fix the underlying code issues instead of changing or suppressing the rules.

React Review found 0 errors and 557 warnings. This PR makes the React health score 87 points better.

<file name="packages/react-doctor/src/core/rules/lint/react-native/rn-prefer-content-inset-adjustment.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/react-native/rn-prefer-content-inset-adjustment.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/server/utils/contains-auth-check.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/server/utils/contains-auth-check.ts:1">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/performance/js-tosorted-immutable.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/performance/js-tosorted-immutable.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/react-native/rn-no-web-dom-elements.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/react-native/rn-no-web-dom-elements.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/performance/js-set-map-lookups.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/performance/js-set-map-lookups.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/react-native/rn-no-single-element-style-array.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/react-native/rn-no-single-element-style-array.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/server/utils/collect-identifier-params.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/server/utils/collect-identifier-params.ts:1">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/performance/js-request-idle-callback.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/performance/js-request-idle-callback.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/react-native/rn-no-scrollview-mapped-list.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/react-native/rn-no-scrollview-mapped-list.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/server/utils/collect-declared-names.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/server/utils/collect-declared-names.ts:1">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/react-native/rn-no-scroll-state.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/react-native/rn-no-scroll-state.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/performance/js-min-max-loop.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/performance/js-min-max-loop.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/server/utils/call-reads-handler-args.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/server/utils/call-reads-handler-args.ts:1">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/react-native/rn-no-raw-text.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/react-native/rn-no-raw-text.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

<file name="packages/react-doctor/src/core/rules/lint/performance/js-length-check-first.ts">

<violation number="1" location="packages/react-doctor/src/core/rules/lint/performance/js-length-check-first.ts:2">
Severity: Warning

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: `import { Button } from './components/Button'` instead of `./components`

Rule: `no-barrel-import`
</violation>

</file>

Showing 15 of 557 issues.

Reviewed by react-review for commit c9c3cc9191abff9d40189d71aa4a61bf307ff288. Configure here.

react-doctor[bot] avatar May 13 '26 07:05 react-doctor[bot]

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-doctor-website Ready Ready Preview, Comment May 13, 2026 2:46pm

vercel[bot] avatar May 13 '26 07:05 vercel[bot]

Open in StackBlitz

npm i https://pkg.pr.new/react-doctor@217

commit: c9c3cc9

pkg-pr-new[bot] avatar May 13 '26 08:05 pkg-pr-new[bot]