Run react-doctor to scan React codebase for health issues. Diagnose security, performance, correctness, architecture problems with 0-100 score.
Scan React codebase for security, performance, correctness, and architecture issues. Outputs a 0-100 health score with actionable diagnostics.
# Full scan with file details
npx -y react-doctor@latest . --verbose
# Scan only changed files (vs base branch)
npx -y react-doctor@latest . --verbose --diff
# Score only (for CI)
npx -y react-doctor@latest . --score
Detects framework (Next.js, Vite, Remix, etc.), React version, and compiler setup, then runs two parallel passes:
| Category | Examples | |----------|----------| | State & Effects | missing deps, stale closures, unnecessary re-renders | | Performance | unoptimized renders, missing memoization, large bundles | | Architecture | circular deps, prop drilling, god components | | Bundle Size | unused imports, heavy dependencies | | Security | dangerouslySetInnerHTML, XSS vectors | | Correctness | key prop misuse, effect cleanup, race conditions | | Accessibility | missing ARIA, no-autofocus, semantic HTML | | Framework-specific | Next.js patterns, React Native issues |
| Flag | Description |
|------|-------------|
| --verbose | Show file details and line numbers per rule |
| --no-lint | Skip linting |
| --no-dead-code | Skip dead code detection |
| --score | Output only the score |
| --diff [base] | Scan only files changed vs base branch |
| --project <name> | Select workspace project (comma-separated) |
| -y, --yes | Skip prompts, scan all workspace projects |
| --fix | Open Ami to auto-fix all issues |
Create react-doctor.config.json at project root:
{
"ignore": {
"rules": ["react/no-danger", "knip/exports"],
"files": ["src/generated/**"]
}
}
Or use "reactDoctor" key in package.json. Config file takes precedence.
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| ignore.rules | string[] | [] | Rules to suppress (plugin/rule format) |
| ignore.files | string[] | [] | File globs to exclude |
| lint | boolean | true | Enable/disable lint checks |
| deadCode | boolean | true | Enable/disable dead code detection |
| verbose | boolean | false | Show file details per rule |
| diff | boolean\|string | — | Force diff mode or pin base branch |
import { diagnose } from "react-doctor/api";
const result = await diagnose(".", { lint: true, deadCode: true });
// result.score → { score: 82, label: "Good" }
// result.diagnostics → Array of { filePath, plugin, rule, severity, message, help, line, column, category }
npx -y react-doctor@latest . --verbose- uses: millionco/react-doctor@main
with:
diff: main
verbose: true
github-token: ${{ secrets.GITHUB_TOKEN }}
Posts findings as PR comment when github-token is set on pull_request events.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer