{
  "$id": "https://json.schemastore.org/lintstagedrc.schema.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "anyOf": [
    {
      "$ref": "#/definitions/advancedConfig"
    },
    {
      "$ref": "#/definitions/basicConfig"
    }
  ],
  "definitions": {
    "$schemaProperty": {
      "type": "string"
    },
    "linter": {
      "type": ["string", "array"]
    },
    "lintersMap": {
      "description": "keys (String) are glob patterns, values (Array<String> | String) are commands to execute.",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/linter"
      }
    },
    "globOptions": {
      "description": "micromatch options to customize how glob patterns match files.",
      "type": "object",
      "properties": {
        "matchBase": {
          "type": "boolean",
          "default": true
        },
        "dot": {
          "type": "boolean",
          "default": true
        }
      },
      "additionalProperties": false
    },
    "advancedConfig": {
      "properties": {
        "$schema": {
          "$ref": "#/definitions/$schemaProperty"
        },
        "concurrent": {
          "description": "Controls if linters are run simultaneously for each glob pattern.",
          "type": "boolean",
          "default": true
        },
        "chunkSize": {
          "description": "Max allowed chunk size based on number of files for glob pattern. This option is only applicable on Windows based systems to avoid command length limitations",
          "type": "number",
          "minimum": 1
        },
        "globOptions": {
          "description": "micromatch options to customize how glob patterns match files.",
          "$ref": "#/definitions/globOptions"
        },
        "linters": {
          "description": "keys (String) are glob patterns, values (Array<String> | String) are commands to execute.",
          "$ref": "#/definitions/lintersMap"
        },
        "ignore": {
          "description": "array of glob patterns to entirely ignore from any task.",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": "['**/docs/**/*.js']"
        },
        "subTaskConcurrency": {
          "description": "Controls concurrency for processing chunks generated for each linter. This option is only applicable on Windows. Execution is not concurrent by default.",
          "type": "integer",
          "minimum": 1,
          "default": 1
        },
        "renderer": {
          "enum": ["update", "verbose"],
          "default": "update"
        },
        "relative": {
          "description": "If true it will give the relative path from your package.json directory to your linter arguments.",
          "type": "boolean",
          "default": false
        }
      },
      "additionalProperties": false
    },
    "basicConfig": {
      "properties": {
        "$schema": {
          "$ref": "#/definitions/$schemaProperty"
        }
      },
      "propertyNames": {
        "not": {
          "enum": [
            "concurrent",
            "chunkSize",
            "globOptions",
            "linters",
            "ignore",
            "subTaskConcurrency",
            "renderer",
            "relative"
          ]
        }
      },
      "additionalProperties": {
        "$ref": "#/definitions/linter"
      }
    }
  }
}
