Config files

React Doctor reads configuration from react-doctor.config.json in your project root.

You can also use a reactDoctor key in package.json.

CLI flags always win over config values.

Example

{
  "ignore": {
    "rules": ["react-doctor/no-danger"],
    "files": ["src/generated/**"],
    "overrides": [
      {
        "files": ["components/search/HighlightedSnippet.tsx"],
        "rules": ["react-doctor/no-danger"]
      }
    ]
  },
  "rules": {
    "react-doctor/no-array-index-as-key": "error"
  },
  "categories": {
    "React Native": "warn"
  }
}

Common keys

KeyTypeDefaultPurpose
ignore.rulesstring[][]Silence a rule everywhere
ignore.filesstring[][]Silence all rules on matching files
ignore.overrides{ files, rules? }[][]Silence specific rules for specific files
lintbooleantrueEnable lint diagnostics
verbosebooleanfalseShow more detail
diffboolean | stringScan only changed files
failOn"error" | "warning" | "none"noneControl non-zero exits
customRulesOnlybooleanfalseRun only configured custom rules
sharebooleantrueEnable share URL behavior
offlinebooleanfalseSkip score API calls
textComponentsstring[][]React Native text component aliases
rawTextWrapperComponentsstring[][]React Native string wrapper components
serverAuthFunctionNamesstring[][]Accepted server auth guard names
respectInlineDisablesbooleantrueRespect inline lint disables
adoptExistingLintConfigbooleantrueMerge existing JSON lint config
ignore.tagsstring[][]Suppress rule families by tag
rulesobjectOverride individual rule severity
categoriesobjectOverride severity for a category
surfacesobjectTune CLI, score, PR comments, and CI failure

React Native escape hatches

Use textComponents for components that behave like React Native's <Text>:

{
  "textComponents": ["Typography", "NativeTabs.Trigger.Label"]
}

Use rawTextWrapperComponents for components that route string children through an internal text component:

{
  "rawTextWrapperComponents": ["Button"]
}

Server auth guards

Use serverAuthFunctionNames when your server actions use custom auth helpers:

{
  "serverAuthFunctionNames": ["requireWorkspaceMember", "ensureSignedIn"]
}

Existing lint config

React Doctor can adopt JSON ESLint and oxlint config automatically. Set adoptExistingLintConfig: false if you want React Doctor to ignore existing lint config.