@eslinted/core 26.1.4 → 27.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/factory/index.d.ts +5 -5
- package/dist/factory/index.d.ts.map +1 -1
- package/dist/factory/index.js +1 -1
- package/dist/factory/index.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.input.spec.d.ts +169 -204
- package/dist/index.input.spec.d.ts.map +1 -1
- package/dist/index.input.spec.js +198 -207
- package/dist/index.input.spec.js.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/index.spec.js +2 -3
- package/dist/index.spec.js.map +1 -1
- package/dist/interface/{configuration/defaults → defaults}/index.d.ts +1 -1
- package/dist/interface/defaults/index.d.ts.map +1 -0
- package/dist/{scope/dependencies → interface/defaults}/index.js.map +1 -1
- package/dist/interface/defaults/settings/index.d.ts.map +1 -0
- package/dist/interface/defaults/settings/index.js.map +1 -0
- package/dist/interface/defaults/settings/manifest.d.ts.map +1 -0
- package/dist/interface/defaults/settings/manifest.js.map +1 -0
- package/dist/interface/extensions/global.d.ts.map +1 -0
- package/dist/interface/extensions/global.js.map +1 -0
- package/dist/interface/extensions/index.d.ts.map +1 -0
- package/dist/interface/extensions/index.js.map +1 -0
- package/dist/interface/{configuration/extensions → extensions}/scopes.d.ts +1 -1
- package/dist/interface/extensions/scopes.d.ts.map +1 -0
- package/dist/interface/extensions/scopes.js.map +1 -0
- package/dist/interface/index.d.ts +5 -5
- package/dist/interface/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/factory/index.ts +13 -16
- package/src/index.input.spec.ts +202 -207
- package/src/index.spec.ts +14 -3
- package/src/index.ts +24 -23
- package/src/interface/{configuration/defaults → defaults}/index.ts +1 -1
- package/src/interface/{configuration/defaults → defaults}/settings/index.ts +4 -1
- package/src/interface/{configuration/extensions → extensions}/scopes.ts +1 -1
- package/src/interface/index.ts +10 -13
- package/dist/interface/configuration/defaults/index.d.ts.map +0 -1
- package/dist/interface/configuration/defaults/index.js.map +0 -1
- package/dist/interface/configuration/defaults/settings/index.d.ts.map +0 -1
- package/dist/interface/configuration/defaults/settings/index.js.map +0 -1
- package/dist/interface/configuration/defaults/settings/manifest.d.ts.map +0 -1
- package/dist/interface/configuration/defaults/settings/manifest.js.map +0 -1
- package/dist/interface/configuration/extensions/global.d.ts.map +0 -1
- package/dist/interface/configuration/extensions/global.js.map +0 -1
- package/dist/interface/configuration/extensions/index.d.ts.map +0 -1
- package/dist/interface/configuration/extensions/index.js.map +0 -1
- package/dist/interface/configuration/extensions/scopes.d.ts.map +0 -1
- package/dist/interface/configuration/extensions/scopes.js.map +0 -1
- package/dist/interface/configuration/index.d.ts +0 -7
- package/dist/interface/configuration/index.d.ts.map +0 -1
- package/dist/interface/configuration/index.js +0 -2
- package/dist/interface/configuration/index.js.map +0 -1
- package/dist/interface/imports.d.ts +0 -5
- package/dist/interface/imports.d.ts.map +0 -1
- package/dist/interface/imports.js +0 -2
- package/dist/interface/imports.js.map +0 -1
- package/dist/scope/dependencies/index.d.ts +0 -3
- package/dist/scope/dependencies/index.d.ts.map +0 -1
- package/dist/scope/dependencies/index.js +0 -2
- package/dist/scope/dependencies/parsers.d.ts +0 -2
- package/dist/scope/dependencies/parsers.d.ts.map +0 -1
- package/dist/scope/dependencies/parsers.js +0 -2
- package/dist/scope/dependencies/parsers.js.map +0 -1
- package/dist/scope/dependencies/plugins.d.ts +0 -2
- package/dist/scope/dependencies/plugins.d.ts.map +0 -1
- package/dist/scope/dependencies/plugins.js +0 -2
- package/dist/scope/dependencies/plugins.js.map +0 -1
- package/dist/scope/index.d.ts +0 -18
- package/dist/scope/index.d.ts.map +0 -1
- package/dist/scope/index.js +0 -15
- package/dist/scope/index.js.map +0 -1
- package/dist/scope/index.spec.d.ts +0 -2
- package/dist/scope/index.spec.d.ts.map +0 -1
- package/dist/scope/index.spec.js +0 -86
- package/dist/scope/index.spec.js.map +0 -1
- package/dist/scope/tree.d.ts +0 -2
- package/dist/scope/tree.d.ts.map +0 -1
- package/dist/scope/tree.js +0 -23
- package/dist/scope/tree.js.map +0 -1
- package/dist/scope/tree.spec.d.ts +0 -2
- package/dist/scope/tree.spec.d.ts.map +0 -1
- package/dist/scope/tree.spec.js +0 -78
- package/dist/scope/tree.spec.js.map +0 -1
- package/src/interface/configuration/index.ts +0 -19
- package/src/interface/imports.ts +0 -13
- package/src/scope/dependencies/index.ts +0 -2
- package/src/scope/dependencies/parsers.ts +0 -4
- package/src/scope/dependencies/plugins.ts +0 -11
- package/src/scope/index.spec.ts +0 -136
- package/src/scope/index.ts +0 -18
- package/src/scope/tree.spec.ts +0 -124
- package/src/scope/tree.ts +0 -22
- /package/dist/interface/{configuration/defaults → defaults}/index.js +0 -0
- /package/dist/interface/{configuration/defaults → defaults}/settings/index.d.ts +0 -0
- /package/dist/interface/{configuration/defaults → defaults}/settings/index.js +0 -0
- /package/dist/interface/{configuration/defaults → defaults}/settings/manifest.d.ts +0 -0
- /package/dist/interface/{configuration/defaults → defaults}/settings/manifest.js +0 -0
- /package/dist/interface/{configuration/extensions → extensions}/global.d.ts +0 -0
- /package/dist/interface/{configuration/extensions → extensions}/global.js +0 -0
- /package/dist/interface/{configuration/extensions → extensions}/index.d.ts +0 -0
- /package/dist/interface/{configuration/extensions → extensions}/index.js +0 -0
- /package/dist/interface/{configuration/extensions → extensions}/scopes.js +0 -0
- /package/src/interface/{configuration/defaults → defaults}/settings/manifest.ts +0 -0
- /package/src/interface/{configuration/extensions → extensions}/global.ts +0 -0
- /package/src/interface/{configuration/extensions → extensions}/index.ts +0 -0
package/src/factory/index.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Configuration } from "../interface";
|
|
2
2
|
|
|
3
3
|
export default function factory<
|
|
4
4
|
Scope extends string,
|
|
5
5
|
Optional extends Scope,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
RequiredPlugin extends string,
|
|
7
|
+
RequiredParser extends Scope,
|
|
8
|
+
Parser extends RequiredParser | Optional,
|
|
8
9
|
>(
|
|
9
10
|
scopes: readonly Scope[],
|
|
10
11
|
optional: readonly Optional[],
|
|
@@ -18,21 +19,17 @@ export default function factory<
|
|
|
18
19
|
plugins,
|
|
19
20
|
parsers,
|
|
20
21
|
}: {
|
|
21
|
-
plugins: Record<
|
|
22
|
-
parsers: Record<
|
|
22
|
+
plugins: Record<RequiredPlugin, unknown>;
|
|
23
|
+
parsers: Record<RequiredParser, unknown> & Partial<Record<Optional, unknown>>;
|
|
23
24
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Parser
|
|
29
|
-
>["configuration"]["defaults"],
|
|
30
|
-
extensions: Input<
|
|
25
|
+
{
|
|
26
|
+
defaults,
|
|
27
|
+
extensions = {},
|
|
28
|
+
}: Configuration<
|
|
31
29
|
Scope,
|
|
32
30
|
Optional,
|
|
33
|
-
Plugin,
|
|
34
31
|
Parser
|
|
35
|
-
|
|
32
|
+
>,
|
|
36
33
|
) {
|
|
37
34
|
for (const scope of optional)
|
|
38
35
|
if (extensions[scope] !== undefined) {
|
|
@@ -226,10 +223,10 @@ export default function factory<
|
|
|
226
223
|
} = settings;
|
|
227
224
|
|
|
228
225
|
if (languageOptions?.parser !== undefined)
|
|
229
|
-
languageOptions.parser = parsers[languageOptions.parser
|
|
226
|
+
languageOptions.parser = parsers[languageOptions.parser] as unknown as Parser;
|
|
230
227
|
|
|
231
228
|
if (parserOptions?.parser !== undefined)
|
|
232
|
-
parserOptions.parser = parsers[parserOptions.parser
|
|
229
|
+
parserOptions.parser = parsers[parserOptions.parser] as unknown as Parser;
|
|
233
230
|
|
|
234
231
|
if (languageOptions === undefined) {
|
|
235
232
|
if (
|
package/src/index.input.spec.ts
CHANGED
|
@@ -6,236 +6,231 @@ const enum State {
|
|
|
6
6
|
const Plugin = "MOCK_PLUGIN",
|
|
7
7
|
Parser = (scope: string) => `MOCK_PARSER:${scope}`;
|
|
8
8
|
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
export const scopes = [
|
|
10
|
+
"js",
|
|
11
|
+
"ts",
|
|
12
|
+
"mocha",
|
|
13
|
+
"svelte",
|
|
14
|
+
"html",
|
|
15
|
+
"json",
|
|
16
|
+
"jsonc",
|
|
17
|
+
"jsoncc",
|
|
18
|
+
] as const,
|
|
19
|
+
optional = ["svelte"] as const,
|
|
20
|
+
tree = [
|
|
21
|
+
[
|
|
22
|
+
"jsoncc",
|
|
23
|
+
["jsonc"],
|
|
24
|
+
] as const,
|
|
25
|
+
[
|
|
26
|
+
"jsonc",
|
|
27
|
+
["json"],
|
|
28
|
+
] as const,
|
|
29
|
+
[
|
|
30
|
+
"mocha",
|
|
31
|
+
["ts"],
|
|
32
|
+
] as const,
|
|
33
|
+
[
|
|
34
|
+
"svelte",
|
|
35
|
+
["ts"],
|
|
36
|
+
] as const,
|
|
37
|
+
[
|
|
38
|
+
"ts",
|
|
39
|
+
["js"],
|
|
40
|
+
] as const,
|
|
41
|
+
],
|
|
42
|
+
imports = {
|
|
43
|
+
plugins: {
|
|
44
|
+
"@stylistic": Plugin,
|
|
45
|
+
"@typescript-eslint": Plugin,
|
|
46
|
+
mocha: Plugin,
|
|
47
|
+
"chai-friendly": Plugin,
|
|
48
|
+
"chai-expect": Plugin,
|
|
49
|
+
html: Plugin,
|
|
50
|
+
json: Plugin,
|
|
51
|
+
jsonc: Plugin,
|
|
28
52
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
languageOptions: {
|
|
41
|
-
parser: "svelte" as const,
|
|
42
|
-
},
|
|
43
|
-
parserOptions: {
|
|
44
|
-
parser: "ts" as const,
|
|
45
|
-
extraFileExtensions: [".svelte"],
|
|
46
|
-
},
|
|
47
|
-
processor: "svelte/svelte",
|
|
48
|
-
},
|
|
49
|
-
html: {
|
|
50
|
-
languageOptions: {
|
|
51
|
-
parser: "html" as const,
|
|
52
|
-
},
|
|
53
|
-
parserOptions: {
|
|
54
|
-
frontmatter: true,
|
|
55
|
-
},
|
|
56
|
-
language: "html/html",
|
|
53
|
+
parsers: {
|
|
54
|
+
ts: Parser("TS"),
|
|
55
|
+
html: Parser("HTML"),
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
configuration = {
|
|
59
|
+
defaults: {
|
|
60
|
+
settings: {
|
|
61
|
+
ts: {
|
|
62
|
+
languageOptions: {
|
|
63
|
+
parser: "ts" as const,
|
|
57
64
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
language: "css/css",
|
|
65
|
+
},
|
|
66
|
+
svelte: {
|
|
67
|
+
languageOptions: {
|
|
68
|
+
parser: "svelte" as const,
|
|
63
69
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
language: "json/jsonc",
|
|
70
|
+
parserOptions: {
|
|
71
|
+
parser: "ts" as const,
|
|
72
|
+
extraFileExtensions: [".svelte"],
|
|
69
73
|
},
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
processor: "svelte/svelte",
|
|
75
|
+
},
|
|
76
|
+
html: {
|
|
77
|
+
languageOptions: {
|
|
78
|
+
parser: "html" as const,
|
|
72
79
|
},
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
parserOptions: {
|
|
81
|
+
frontmatter: true,
|
|
75
82
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
language: "html/html",
|
|
84
|
+
},
|
|
85
|
+
json: {
|
|
86
|
+
languageOptions: {
|
|
87
|
+
allowTrailingCommas: true,
|
|
80
88
|
},
|
|
89
|
+
language: "json/jsonc",
|
|
81
90
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
ts: ["default.ts"],
|
|
85
|
-
mocha: ["default.mocha"],
|
|
86
|
-
svelte: ["default.svelte"],
|
|
87
|
-
html: ["default.html"],
|
|
88
|
-
css: ["default.css"],
|
|
89
|
-
json: ["default.json"],
|
|
90
|
-
jsonc: ["default.jsonc"],
|
|
91
|
-
jsoncc: ["default-comma.jsonc"],
|
|
92
|
-
yml: ["default.yml"],
|
|
91
|
+
jsonc: {
|
|
92
|
+
language: "json/jsonc",
|
|
93
93
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
js: ["ignore/default.js"],
|
|
97
|
-
ts: ["ignore/default.ts"],
|
|
98
|
-
mocha: ["ignore/default.mocha"],
|
|
99
|
-
svelte: ["ignore/default.svelte"],
|
|
100
|
-
html: ["ignore/default.html"],
|
|
101
|
-
css: ["ignore/default.css"],
|
|
102
|
-
json: ["ignore/default.json"],
|
|
103
|
-
jsonc: ["ignore/default.jsonc"],
|
|
104
|
-
jsoncc: ["ignore/default-comma.jsonc"],
|
|
105
|
-
yml: ["ignore/default.yml"],
|
|
94
|
+
jsoncc: {
|
|
95
|
+
language: "json/jsonc",
|
|
106
96
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
97
|
+
},
|
|
98
|
+
files: {
|
|
99
|
+
js: ["default.js"],
|
|
100
|
+
ts: ["default.ts"],
|
|
101
|
+
mocha: ["default.mocha"],
|
|
102
|
+
svelte: ["default.svelte"],
|
|
103
|
+
html: ["default.html"],
|
|
104
|
+
json: ["default.json"],
|
|
105
|
+
jsonc: ["default.jsonc"],
|
|
106
|
+
jsoncc: ["default-comma.jsonc"],
|
|
107
|
+
},
|
|
108
|
+
ignores: {
|
|
109
|
+
"*": ["ignore/default.*"],
|
|
110
|
+
js: ["ignore/default.js"],
|
|
111
|
+
ts: ["ignore/default.ts"],
|
|
112
|
+
mocha: ["ignore/default.mocha"],
|
|
113
|
+
svelte: ["ignore/default.svelte"],
|
|
114
|
+
html: ["ignore/default.html"],
|
|
115
|
+
json: ["ignore/default.json"],
|
|
116
|
+
jsonc: ["ignore/default.jsonc"],
|
|
117
|
+
jsoncc: ["ignore/default-comma.jsonc"],
|
|
118
|
+
},
|
|
119
|
+
rules: {
|
|
120
|
+
js: [
|
|
121
|
+
{
|
|
122
|
+
id: "enable",
|
|
123
|
+
rules: {
|
|
124
|
+
vanilla: State.ERROR,
|
|
125
|
+
vanilla0: State.ERROR,
|
|
126
|
+
vanilla1: State.ERROR,
|
|
127
|
+
vanilla2: State.ERROR,
|
|
131
128
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"@typescript-eslint/global": State.ERROR,
|
|
138
|
-
},
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "enable/stylistic",
|
|
132
|
+
rules: {
|
|
133
|
+
"@stylistic/style-rule": State.ERROR,
|
|
139
134
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
ts: [
|
|
138
|
+
{
|
|
139
|
+
id: "disable",
|
|
140
|
+
rules: {
|
|
141
|
+
vanilla0: State.OFF,
|
|
147
142
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "enable/extension",
|
|
146
|
+
rules: {
|
|
147
|
+
"@typescript-eslint/enums": State.ERROR,
|
|
148
|
+
"@typescript-eslint/destructure-expression": State.ERROR,
|
|
149
|
+
"@typescript-eslint/global": State.ERROR,
|
|
153
150
|
},
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
mocha: [
|
|
154
|
+
{
|
|
155
|
+
id: "disable",
|
|
156
|
+
rules: {
|
|
157
|
+
vanilla2: State.OFF,
|
|
159
158
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
vanilla1: State.OFF,
|
|
166
|
-
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: "disable/ts",
|
|
162
|
+
rules: {
|
|
163
|
+
"@typescript-eslint/global": State.ERROR,
|
|
167
164
|
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: "enable",
|
|
168
|
+
rules: {
|
|
169
|
+
"mocha/test-expression": State.ERROR,
|
|
173
170
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
svelte: [
|
|
174
|
+
{
|
|
175
|
+
id: "disable",
|
|
176
|
+
rules: {
|
|
177
|
+
vanilla1: State.OFF,
|
|
181
178
|
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
"css/property": State.ERROR,
|
|
188
|
-
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: "enable-extension",
|
|
182
|
+
rules: {
|
|
183
|
+
"svelte/tags": State.ERROR,
|
|
189
184
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
State.ERROR,
|
|
198
|
-
"never",
|
|
199
|
-
] as const,
|
|
200
|
-
"jsonc/trailing-comma": [
|
|
201
|
-
State.ERROR,
|
|
202
|
-
"never",
|
|
203
|
-
] as const,
|
|
204
|
-
},
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
html: [
|
|
188
|
+
{
|
|
189
|
+
id: "enable",
|
|
190
|
+
rules: {
|
|
191
|
+
"html/attribute": State.ERROR,
|
|
205
192
|
},
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
json: [
|
|
196
|
+
{
|
|
197
|
+
id: "enable",
|
|
198
|
+
rules: {
|
|
199
|
+
"jsonc/property-check": State.ERROR,
|
|
200
|
+
"jsonc/comment": [
|
|
201
|
+
State.ERROR,
|
|
202
|
+
"never",
|
|
203
|
+
] as const,
|
|
204
|
+
"jsonc/trailing-comma": [
|
|
205
|
+
State.ERROR,
|
|
206
|
+
"never",
|
|
207
|
+
] as const,
|
|
216
208
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
jsonc: [
|
|
212
|
+
{
|
|
213
|
+
id: "override-comment",
|
|
214
|
+
rules: {
|
|
215
|
+
"jsonc/comment": [
|
|
216
|
+
State.ERROR,
|
|
217
|
+
"allow",
|
|
218
|
+
] as const,
|
|
227
219
|
},
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
jsoncc: [
|
|
223
|
+
{
|
|
224
|
+
id: "override-comma",
|
|
225
|
+
rules: {
|
|
226
|
+
"jsonc/trailing-comma": [
|
|
227
|
+
State.ERROR,
|
|
228
|
+
"allow",
|
|
229
|
+
] as const,
|
|
235
230
|
},
|
|
236
|
-
|
|
237
|
-
|
|
231
|
+
},
|
|
232
|
+
],
|
|
238
233
|
},
|
|
239
|
-
extensions: {},
|
|
240
234
|
},
|
|
235
|
+
extensions: {},
|
|
241
236
|
};
|
package/src/index.spec.ts
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import "chai/register-should.js";
|
|
2
2
|
import Core from ".";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
scopes,
|
|
5
|
+
optional,
|
|
6
|
+
tree,
|
|
7
|
+
imports,
|
|
8
|
+
configuration,
|
|
9
|
+
} from "./index.input.spec";
|
|
5
10
|
|
|
6
|
-
const configs = Core(
|
|
11
|
+
const configs = Core(
|
|
12
|
+
scopes,
|
|
13
|
+
optional,
|
|
14
|
+
tree,
|
|
15
|
+
imports,
|
|
16
|
+
configuration,
|
|
17
|
+
);
|
|
7
18
|
|
|
8
19
|
describe(
|
|
9
20
|
"Core",
|
package/src/index.ts
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
Plugin,
|
|
4
|
-
Parser,
|
|
5
|
-
} from "./scope";
|
|
6
|
-
import {
|
|
7
|
-
scopes,
|
|
8
|
-
optional,
|
|
9
|
-
tree,
|
|
10
|
-
} from "./scope";
|
|
1
|
+
import type { Configuration } from "./interface";
|
|
11
2
|
import factory from "./factory";
|
|
12
3
|
|
|
13
|
-
export default function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
export default function<
|
|
5
|
+
Scope extends string,
|
|
6
|
+
Optional extends Scope,
|
|
7
|
+
RequiredPlugin extends string,
|
|
8
|
+
RequiredParser extends Scope,
|
|
9
|
+
Parser extends RequiredParser | Optional,
|
|
10
|
+
>(
|
|
11
|
+
scopes: readonly Scope[],
|
|
12
|
+
optional: readonly Optional[],
|
|
13
|
+
tree: Array<
|
|
14
|
+
readonly [
|
|
15
|
+
Scope,
|
|
16
|
+
readonly Scope[],
|
|
17
|
+
]
|
|
18
|
+
>,
|
|
19
|
+
imports: {
|
|
20
|
+
plugins: Record<RequiredPlugin, unknown>;
|
|
21
|
+
parsers: Record<RequiredParser, unknown> & Partial<Record<Optional, unknown>>;
|
|
22
|
+
},
|
|
23
|
+
configuration: Configuration<
|
|
24
|
+
Scope,
|
|
25
|
+
Optional,
|
|
24
26
|
Parser
|
|
25
27
|
>,
|
|
26
28
|
) {
|
|
@@ -29,7 +31,6 @@ export default function (
|
|
|
29
31
|
optional,
|
|
30
32
|
tree,
|
|
31
33
|
imports,
|
|
32
|
-
|
|
33
|
-
extensions,
|
|
34
|
+
configuration,
|
|
34
35
|
);
|
|
35
36
|
}
|
package/src/interface/index.ts
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { Defaults } from "./defaults";
|
|
2
|
+
import type { Extensions } from "./extensions";
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface Configuration<
|
|
5
5
|
Scope extends string,
|
|
6
6
|
Optional extends Scope,
|
|
7
|
-
Plugin extends string,
|
|
8
7
|
Parser extends Scope,
|
|
9
8
|
> {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
defaults: Defaults<
|
|
10
|
+
Scope,
|
|
12
11
|
Parser
|
|
13
12
|
>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
| Optional
|
|
20
|
-
)
|
|
13
|
+
extensions: Partial<
|
|
14
|
+
Extensions<
|
|
15
|
+
Scope,
|
|
16
|
+
Optional
|
|
17
|
+
>
|
|
21
18
|
>;
|
|
22
19
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/configuration/defaults/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,WAAW,QAAQ,CACvB,KAAK,SAAS,MAAM,EACpB,MAAM,SAAS,KAAK;IAEpB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CACxB,KAAK,EACL,MAAM,CACP,CAAC,CAAC;IACH,KAAK,EAAE,OAAO,CAAC,MAAM,CACnB,KAAK,EACL,MAAM,EAAE,CACT,CAAC,CAAC;IACH,OAAO,EACH,MAAM,CACN,GAAG,EACH,MAAM,EAAE,CACT,GACC,OAAO,CAAC,MAAM,CACd,KAAK,EACL,MAAM,EAAE,CACT,CAAC,CAAC;IACL,KAAK,EAAE,OAAO,CAAC,MAAM,CACnB,KAAK,EACL;QACE,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,KAAK,CAAC;KACd,EAAE,CACJ,CAAC,CAAC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interface/configuration/defaults/index.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/interface/configuration/defaults/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,QAAQ,CAClB,KAAK,SAAS,MAAM,EACpB,MAAM,SAAS,KAAK,IAClB,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/interface/configuration/defaults/settings/index.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../../src/interface/configuration/defaults/settings/manifest.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa,CAC5B,MAAM,SAAS,MAAM;IAErB,eAAe,CAAC,EAAE;QAChB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,aAAa,CAAC,EAAE;QACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../../../src/interface/configuration/defaults/settings/manifest.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../../src/interface/configuration/extensions/global.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE;QACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../../../src/interface/configuration/extensions/global.ts"],"names":[],"mappings":""}
|