Quick Start
Run React Doctor at your project root:
npx -y react-doctor@latest .
Verbose Output
Show affected files and line numbers for each diagnostic:
npx -y react-doctor@latest . --verbose
Score Only Mode
Get just the health score (0-100) without diagnostics:
npx -y react-doctor@latest . --score
This is useful for scripting and tracking score over time:
# Save score to a file
SCORE=$(npx -y react-doctor@latest . --score)
echo "Current score: $SCORE"
Monorepo / Workspace Projects
Scan specific project
Use --project to scan a single workspace project:npx -y react-doctor@latest . --project web
Scan multiple projects
Comma-separate project names to scan multiple:npx -y react-doctor@latest . --project web,admin,mobile
Scan all projects without prompts
Use -y or --yes to skip the project selection prompt:npx -y react-doctor@latest . --yes
Selective Analysis
Skip Linting
Run only dead code detection:
npx -y react-doctor@latest . --no-lint
Skip Dead Code Detection
Run only linting:
npx -y react-doctor@latest . --no-dead-code
Skip Both (Dry Run)
Validate configuration and project detection:
npx -y react-doctor@latest . --no-lint --no-dead-code
Diff Mode
Scan only files that changed compared to a base branch:
npx -y react-doctor@latest . --diff main
Diff mode is perfect for:
- Pull request checks
- Incremental adoption in large codebases
- Faster scans during development
When using --diff in CI, make sure to check out the full git history with fetch-depth: 0
Package Manager Variations
npx -y react-doctor@latest . --verbose
Common Workflows
Development Workflow
Quick check during development:
npx -y react-doctor@latest . --diff main --verbose
Pre-Release Check
Full scan before merging to main:
npx -y react-doctor@latest . --verbose --yes
Score Tracking
Track score in CI and store as artifact:
SCORE=$(npx -y react-doctor@latest . --score)
echo "$SCORE" > react-doctor-score.txt
echo "Health Score: $SCORE"
Offline Mode
Skip telemetry (anonymous scoring API calls):
npx -y react-doctor@latest . --offline
Telemetry is anonymous and only used to calculate your health score. No code or file names are sent.
Version Check
Display the installed version:
npx -y react-doctor@latest --version
Help
View all available options:
npx -y react-doctor@latest --help