Configuration File
Create areact-doctor.config.json file in your project root to customize React Doctor’s behavior.
react-doctor.config.json
Configuration Options
Scan Options
Enable or disable linting checks using oxlint.
Enable or disable dead code detection using Knip.
Show file details and line numbers for each diagnostic.
Diff Mode
Enable diff mode to scan only changed files.
false: Disabledtrue: Auto-detect changes"branch-name": Compare against specific branch (e.g.,"main")
- Disabled
- Auto-detect
- Specific Branch
Error Handling
Control when React Doctor exits with an error code.
"error": Exit with code 1 only if errors are found"warning": Exit with code 1 if any warnings or errors are found"none": Never exit with error code
Use
"failOn": "error" in CI to fail builds on errors while allowing warnings.Ignore Configuration
Configure rules and files to ignore during scanning.
Array of rule identifiers to ignore. Format:
"plugin/rule-name"Array of glob patterns for files to ignore.
Complete Configuration Example
react-doctor.config.json
Configuration Priority
React Doctor resolves configuration in the following order (highest to lowest priority):- CLI flags: Explicit command-line options
- Configuration file:
react-doctor.config.json - Defaults: Built-in default values
react-doctor.config.json has "lint": true, the --no-lint flag takes precedence.
TypeScript Support
For TypeScript projects, you can use type definitions for better autocomplete:react-doctor.config.json
Finding Rule Names
To find rule names for theignore.rules array:
-
Run React Doctor with
--verboseflag: -
Look for the rule identifier in the output:
-
Add to your config:
Common Patterns
Validation
React Doctor validates the configuration file on load. Invalid configurations will show an error:Location
Placereact-doctor.config.json in:
- Project root (same directory as
package.json) - Workspace root for monorepos