Your First Scan
Navigate to your React project directory and run:React Doctor starts scanning
React Doctor will detect your framework, React version, and begin analyzing your codebase.
Understanding Your Score
React Doctor calculates a health score based on the severity and number of issues:75+ Great
Your codebase is in excellent shape. Minor improvements may still be possible.
50-74 Needs Work
Some issues to address. Focus on errors first, then warnings.
<50 Critical
Significant problems detected. Prioritize fixing errors and major warnings.
Errors weigh more heavily than warnings in the score calculation.
Verbose Output
For detailed diagnostics with file paths and line numbers:Common Options
Diff Mode
Scan only changed files compared to your main branch:Diff mode is perfect for CI/CD pipelines and large codebases. It dramatically speeds up scans by focusing only on what changed.
Score Only
Output just the numeric score (useful for scripting):Skip Lint or Dead Code
Disable specific analysis types:Silent Mode (No Prompts)
Skip all interactive prompts:Understanding Diagnostics
Each diagnostic includes:- Plugin/Rule: The source of the diagnostic (e.g.,
react-hooks/exhaustive-deps,knip/exports) - Severity: Either
errororwarning - File Path: Location of the issue
- Line & Column: Exact position in the file
- Message: Description of the issue
- Category: Type of issue (performance, security, correctness, etc.)
Rule Categories
React Doctor checks 60+ rules across these categories:State & Effects
useState, useEffect, useCallback, useMemo usage
Performance
Re-renders, bundle size, lazy loading
Security
XSS, dangerouslySetInnerHTML, unsafe patterns
Correctness
Prop types, key props, fragment usage
Accessibility
ARIA attributes, semantic HTML, keyboard nav
Architecture
Dead code, unused exports, duplicate code
Next.js
Image optimization, Link usage, metadata
React Native
Platform-specific issues and optimizations
Auto-Fix with Ami
React Doctor integrates with Ami, a coding agent built for React:- Read your React Doctor report
- Understand your codebase
- Fix issues one by one
- Re-run the scan to verify improvements
Ami is free to use and supports all React Doctor diagnostics. Learn more at ami.app
Next Steps
Configuration
Customize rules and ignore patterns for your project
GitHub Actions
Set up React Doctor in your CI/CD pipeline
API Reference
Use React Doctor programmatically in Node.js
Rules Reference
Explore all 60+ rules and their examples
Troubleshooting
React Doctor isn't detecting my framework
React Doctor isn't detecting my framework
Make sure youβre running the command from your project root where
package.json is located.Scan is taking too long
Scan is taking too long
Try using
--diff mode to scan only changed files, or use --no-dead-code to skip dead code detection.Too many false positives
Too many false positives
Create a
react-doctor.config.json file to ignore specific rules or file patterns. See the Configuration guide.Getting TypeScript errors
Getting TypeScript errors
React Doctor requires TypeScript 5.0.4 or higher. Update your TypeScript version: