{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Config",
  "description": "rumdl configuration for linting Markdown files. Rules can be configured individually using [MD###] sections with rule-specific options.",
  "type": "object",
  "properties": {
    "global": {
      "description": "Global configuration options",
      "$ref": "#/$defs/GlobalConfig",
      "default": {
        "enable": [],
        "disable": [],
        "exclude": [],
        "include": [],
        "respect-gitignore": true,
        "line-length": 80,
        "fixable": [],
        "unfixable": [],
        "flavor": "standard",
        "force-exclude": false,
        "cache": true
      }
    },
    "per-file-ignores": {
      "description": "Per-file rule ignores: maps file patterns to lists of rules to ignore\nExample: { \"README.md\": [\"MD033\"], \"docs/**/*.md\": [\"MD013\"] }",
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "default": {}
    },
    "per-file-flavor": {
      "description": "Per-file flavor overrides: maps file patterns to Markdown flavors\nExample: { \"docs/**/*.md\": MkDocs, \"**/*.mdx\": MDX }\nUses IndexMap to preserve config file order for \"first match wins\" semantics",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/MarkdownFlavor"
      },
      "default": {}
    }
  },
  "additionalProperties": {
    "$ref": "#/$defs/RuleConfig"
  },
  "$defs": {
    "GlobalConfig": {
      "description": "Global configuration options",
      "type": "object",
      "properties": {
        "enable": {
          "description": "Enabled rules",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "disable": {
          "description": "Disabled rules",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "exclude": {
          "description": "Files to exclude",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "include": {
          "description": "Files to include",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "respect-gitignore": {
          "description": "Respect .gitignore files when scanning directories",
          "type": "boolean",
          "default": true
        },
        "line-length": {
          "description": "Global line length setting (used by MD013 and other rules if not overridden)",
          "$ref": "#/$defs/LineLength",
          "default": 80
        },
        "output-format": {
          "description": "Output format for linting results (e.g., \"text\", \"json\", \"pylint\", etc.)",
          "type": [
            "string",
            "null"
          ]
        },
        "fixable": {
          "description": "Rules that are allowed to be fixed when --fix is used\nIf specified, only these rules will be fixed",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "unfixable": {
          "description": "Rules that should never be fixed, even when --fix is used\nTakes precedence over fixable",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "flavor": {
          "description": "Markdown flavor/dialect to use (mkdocs, gfm, commonmark, etc.)\nWhen set, adjusts parsing and validation rules for that specific Markdown variant",
          "$ref": "#/$defs/MarkdownFlavor",
          "default": "standard"
        },
        "force-exclude": {
          "description": "[DEPRECATED] Whether to enforce exclude patterns for explicitly passed paths.\nThis option is deprecated as of v0.0.156 and has no effect.\nExclude patterns are now always respected, even for explicitly provided files.\nThis prevents duplication between rumdl config and tool configs like pre-commit.",
          "type": "boolean",
          "deprecated": true,
          "default": false
        },
        "cache-dir": {
          "description": "Directory to store cache files (default: .rumdl_cache)\nCan also be set via --cache-dir CLI flag or RUMDL_CACHE_DIR environment variable",
          "type": [
            "string",
            "null"
          ]
        },
        "cache": {
          "description": "Whether caching is enabled (default: true)\nCan also be disabled via --no-cache CLI flag",
          "type": "boolean",
          "default": true
        }
      }
    },
    "LineLength": {
      "description": "A line length value that can be 0 (meaning no limit) or a positive value (≥1)\n\nMany configuration values for line length need to support both:\n- 0: Special value meaning \"no line length limit\"\n- ≥1: Actual line length limit\n\nThis type enforces those constraints at deserialization time.",
      "type": [
        "integer",
        "null"
      ],
      "format": "uint",
      "minimum": 0
    },
    "MarkdownFlavor": {
      "description": "Markdown flavor/dialect. Accepts: standard, gfm, mkdocs, mdx, quarto. Aliases: commonmark/github map to standard, qmd/rmd/rmarkdown map to quarto.",
      "type": "string",
      "enum": [
        "standard",
        "gfm",
        "github",
        "commonmark",
        "mkdocs",
        "mdx",
        "quarto",
        "qmd",
        "rmd",
        "rmarkdown"
      ]
    },
    "RuleConfig": {
      "description": "Represents a rule-specific configuration",
      "type": "object",
      "properties": {
        "severity": {
          "description": "Severity override for this rule (Error, Warning, or Info)",
          "anyOf": [
            {
              "$ref": "#/$defs/Severity"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": true
    },
    "Severity": {
      "type": "string",
      "enum": [
        "error",
        "warning",
        "info"
      ]
    }
  }
}