Configuration

astro-doctor looks for a doctor.config.* file in the directory you scan. All configuration is optional — the defaults are sensible out of the box.

Supported formats

Any of the following file names are detected, in priority order:

doctor.config.ts
    doctor.config.js
    doctor.config.mjs
    doctor.config.cjs
    doctor.config.json
    doctor.config.jsonc
       
  

Schema

// doctor.config.ts
import type { AstroDoctorConfig } from '@santi020k/astro-doctor'

export default {
  // Override rule severities
  rules: {
    'astro-doctor/no-client-load-overuse': 'error',   // upgrade to error
    'astro-doctor/prefer-class-list': 'off',           // disable a rule
  },

  // Glob patterns to ignore (relative to scanned directory)
  ignore: ['src/legacy/**', 'src/vendor/**'],

  // When to exit with code 1: 'error' | 'warning' | 'off'
  // CLI flag --fail-on overrides this
  failOn: 'error',
} satisfies AstroDoctorConfig
  
  

Fields

rules

Override the default severity of any rule. Accepted values: 'error', 'warn', 'off'.

ignore

An array of glob patterns (relative to the scanned directory) to exclude from the scan. Useful for generated code, vendored components, or legacy directories you're not ready to fix yet.

failOn

Controls when astro-doctor exits with a non-zero exit code:

Value Exits with 1 when…
'error' (default) Any error-severity finding exists
'warning' Any error or warning finding exists
'off' Never (useful for reporting without blocking)

The --fail-on CLI flag takes precedence over the config file value.

JSON / JSONC example

// doctor.config.jsonc
{
  "$schema": "https://doctor.santi020k.com/schema/config.json",
  // Comments are supported in .jsonc
  "rules": {
    "astro-doctor/no-client-load-overuse": "error"
  },
  "ignore": ["src/vendor/**"],
  "failOn": "warning"
}
  
  
Tip: Adding "$schema" enables autocompletion and inline docs for all rule names and values in VS Code, WebStorm, and any editor with JSON Schema support.
Note: When using doctor.config.ts, your project must be able to execute TypeScript files (e.g. via tsx, ts-node, or Bun). If that's not available, use doctor.config.js (ESM) instead.