React Doctor automatically detects monorepo workspaces and lets you scan individual projects or all at once.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/millionco/react-doctor/llms.txt
Use this file to discover all available pages before exploring further.
Automatic Workspace Detection
When you run React Doctor in a monorepo root, it detects workspaces from:package.jsonwithworkspacesfield (npm, Yarn, pnpm)pnpm-workspace.yaml(pnpm)lerna.json(Lerna)
React Doctor only shows workspaces that contain React dependencies.
Selecting a Single Project
Use the--project flag to scan a specific workspace:
web project and skips others.
Finding Project Names
Project names come frompackage.json name field:
packages/web/package.json
Scanning Multiple Projects
Scan several projects by passing comma-separated names:Scanning All Projects
Use the-y flag to skip prompts and scan all React projects:
Monorepo Configuration
Placereact-doctor.config.json at the monorepo root:
react-doctor.config.json
Per-Project Configuration
You can also create project-specific configs:packages/web/react-doctor.config.json
- Root config - Applied to all projects
- Project config - Overrides root for that project
Example: Turborepo
Typical Turborepo structure:Scan All React Apps
web, mobile, and ui (skips config).
Scan Only Web App
Scan Web + Mobile
Example: Yarn Workspaces
Typical Yarn workspaces setup:package.json
Example: pnpm Workspaces
Withpnpm-workspace.yaml:
pnpm-workspace.yaml
Monorepo + Diff Mode
Combine--project and --diff to scan only changed files in a specific project:
Monorepo CI/CD Example
GitHub Actions workflow for monorepos:.github/workflows/react-doctor.yml
web project and only changed files.
Troubleshooting Monorepos
No Workspaces Detected
If React Doctor doesn’t find workspaces:- Check workspace config - Verify
package.jsonorpnpm-workspace.yaml - Run from root - Navigate to monorepo root, not a subdirectory
- Install dependencies - Run
npm installorpnpm installfirst
Project Not Found
If--project fails:
Scanning Takes Too Long
For large monorepos:- Use
--projectto scan specific projects - Use
--diffto scan only changes - Combine both for maximum speed
Inconsistent Scores
If scores vary between projects:- Each project is scanned independently
- The final score combines all diagnostics
- Projects with more issues weigh down the overall score
Best Practices for Monorepos
1. Scan Changed Projects Only in CI
Use path filters to trigger scans only when relevant projects change:2. Create Root Configuration
Define shared rules at the monorepo root:react-doctor.config.json
3. Use Project-Specific Configs Sparingly
Only override rules when absolutely necessary. Too many exceptions make the codebase inconsistent.4. Track Scores Per Project
Run separate scans to monitor each project’s health:React Doctor treats each workspace as an independent project. The overall score reflects the combined health of all scanned projects.