1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | "use strict";
|
7 |
|
8 | const baseConfigProperties = {
|
9 | env: { type: "object" },
|
10 | extends: { $ref: "#/definitions/stringOrStrings" },
|
11 | globals: { type: "object" },
|
12 | overrides: {
|
13 | type: "array",
|
14 | items: { $ref: "#/definitions/overrideConfig" },
|
15 | additionalItems: false
|
16 | },
|
17 | parser: { type: ["string", "null"] },
|
18 | parserOptions: { type: "object" },
|
19 | plugins: { type: "array" },
|
20 | processor: { type: "string" },
|
21 | rules: { type: "object" },
|
22 | settings: { type: "object" },
|
23 | noInlineConfig: { type: "boolean" },
|
24 | reportUnusedDisableDirectives: { type: "boolean" },
|
25 |
|
26 | ecmaFeatures: { type: "object" }
|
27 | };
|
28 |
|
29 | const configSchema = {
|
30 | definitions: {
|
31 | stringOrStrings: {
|
32 | oneOf: [
|
33 | { type: "string" },
|
34 | {
|
35 | type: "array",
|
36 | items: { type: "string" },
|
37 | additionalItems: false
|
38 | }
|
39 | ]
|
40 | },
|
41 | stringOrStringsRequired: {
|
42 | oneOf: [
|
43 | { type: "string" },
|
44 | {
|
45 | type: "array",
|
46 | items: { type: "string" },
|
47 | additionalItems: false,
|
48 | minItems: 1
|
49 | }
|
50 | ]
|
51 | },
|
52 |
|
53 |
|
54 | objectConfig: {
|
55 | type: "object",
|
56 | properties: {
|
57 | root: { type: "boolean" },
|
58 | ...baseConfigProperties
|
59 | },
|
60 | additionalProperties: false
|
61 | },
|
62 |
|
63 |
|
64 | overrideConfig: {
|
65 | type: "object",
|
66 | properties: {
|
67 | excludedFiles: { $ref: "#/definitions/stringOrStrings" },
|
68 | files: { $ref: "#/definitions/stringOrStringsRequired" },
|
69 | ...baseConfigProperties
|
70 | },
|
71 | required: ["files"],
|
72 | additionalProperties: false
|
73 | }
|
74 | },
|
75 |
|
76 | $ref: "#/definitions/objectConfig"
|
77 | };
|
78 |
|
79 | module.exports = configSchema;
|