2 * @fileoverview Defines a schema for configs.
8 const baseConfigProperties = {
9 $schema: { type: "string" },
10 env: { type: "object" },
11 extends: { $ref: "#/definitions/stringOrStrings" },
12 globals: { type: "object" },
15 items: { $ref: "#/definitions/overrideConfig" },
16 additionalItems: false
18 parser: { type: ["string", "null"] },
19 parserOptions: { type: "object" },
20 plugins: { type: "array" },
21 processor: { type: "string" },
22 rules: { type: "object" },
23 settings: { type: "object" },
24 noInlineConfig: { type: "boolean" },
25 reportUnusedDisableDirectives: { type: "boolean" },
27 ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
30 const configSchema = {
37 items: { type: "string" },
38 additionalItems: false
42 stringOrStringsRequired: {
47 items: { type: "string" },
48 additionalItems: false,
54 // Config at top-level.
58 root: { type: "boolean" },
59 ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
60 ...baseConfigProperties
62 additionalProperties: false
65 // Config in `overrides`.
69 excludedFiles: { $ref: "#/definitions/stringOrStrings" },
70 files: { $ref: "#/definitions/stringOrStringsRequired" },
71 ...baseConfigProperties
74 additionalProperties: false
78 $ref: "#/definitions/objectConfig"
81 module.exports = configSchema;