2 * STOP!!! DO NOT MODIFY.
4 * This file is part of the ongoing work to move the eslintrc-style config
5 * system into the @eslint/eslintrc package. This file needs to remain
6 * unchanged in order for this work to proceed.
8 * If you think you need to change this file, please contact @nzakas first.
10 * Thanks in advance for your cooperation.
14 * @fileoverview Defines a schema for configs.
15 * @author Sylvan Mably
20 const baseConfigProperties = {
21 $schema: { type: "string" },
22 env: { type: "object" },
23 extends: { $ref: "#/definitions/stringOrStrings" },
24 globals: { type: "object" },
27 items: { $ref: "#/definitions/overrideConfig" },
28 additionalItems: false
30 parser: { type: ["string", "null"] },
31 parserOptions: { type: "object" },
32 plugins: { type: "array" },
33 processor: { type: "string" },
34 rules: { type: "object" },
35 settings: { type: "object" },
36 noInlineConfig: { type: "boolean" },
37 reportUnusedDisableDirectives: { type: "boolean" },
39 ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
42 const configSchema = {
49 items: { type: "string" },
50 additionalItems: false
54 stringOrStringsRequired: {
59 items: { type: "string" },
60 additionalItems: false,
66 // Config at top-level.
70 root: { type: "boolean" },
71 ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
72 ...baseConfigProperties
74 additionalProperties: false
77 // Config in `overrides`.
81 excludedFiles: { $ref: "#/definitions/stringOrStrings" },
82 files: { $ref: "#/definitions/stringOrStringsRequired" },
83 ...baseConfigProperties
86 additionalProperties: false
90 $ref: "#/definitions/objectConfig"
93 module.exports = configSchema;