@eslinted/core 22.1.4 → 22.1.5-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/.github/workflows/RELEASE.yml +36 -36
- package/.github/workflows/rc.yml +36 -36
- package/.markdownlint.jsonc +128 -128
- package/.mocharc.yml +15 -15
- package/LICENSE +20 -20
- package/README.md +4 -4
- package/eslint.config.js +3 -3
- package/package.json +55 -55
- package/src/_test/index.ts +266 -266
- package/src/factory.ts +306 -306
- package/src/index.spec.ts +106 -106
- package/src/index.ts +87 -87
- package/src/interface/config/index.ts +42 -42
- package/src/interface/config/rule.ts +12 -12
- package/src/interface/index.ts +3 -3
- package/src/interface/input/configuration/attachment.ts +13 -13
- package/src/interface/input/configuration/defaults.ts +24 -24
- package/src/interface/input/configuration/extensions.ts +25 -25
- package/src/interface/input/configuration/index.ts +17 -17
- package/src/interface/input/configuration/manifest/index.ts +15 -15
- package/src/interface/input/configuration/settings.ts +18 -18
- package/src/interface/input/imports/index.ts +16 -16
- package/src/interface/input/imports/optional.ts +11 -11
- package/src/interface/input/imports/required.ts +13 -13
- package/src/interface/input/index.ts +22 -22
- package/src/interface/output/configs/attachment.ts +13 -13
- package/src/interface/output/configs/global/ignores.d.ts +6 -6
- package/src/interface/output/configs/global/index.d.ts +3 -3
- package/src/interface/output/configs/global/plugins.d.ts +6 -6
- package/src/interface/output/configs/global/settings.d.ts +11 -11
- package/src/interface/output/configs/index.d.ts +3 -3
- package/src/interface/output/configs/scoped/index.d.ts +2 -2
- package/src/interface/output/configs/scoped/rules.d.ts +12 -12
- package/src/interface/output/configs/scoped/settings.d.ts +15 -15
- package/src/interface/output/index.d.ts +12 -12
- package/src/scope/dependencies/index.ts +2 -2
- package/src/scope/dependencies/parsers.ts +5 -5
- package/src/scope/dependencies/plugins.ts +12 -12
- package/src/scope/index.spec.ts +136 -136
- package/src/scope/index.ts +18 -18
- package/src/scope/tree/index.spec.ts +124 -124
- package/src/scope/tree/index.ts +22 -22
- package/tsconfig.json +156 -156
package/src/_test/index.ts
CHANGED
@@ -1,266 +1,266 @@
|
|
1
|
-
const
|
2
|
-
ERROR = "error",
|
3
|
-
OFF = "off",
|
4
|
-
Plugin = "MOCK_PLUGIN",
|
5
|
-
Parser = (scope: string) => `MOCK_PARSER:${scope}`;
|
6
|
-
|
7
|
-
export const TEST_INPUT = {
|
8
|
-
imports: {
|
9
|
-
required: {
|
10
|
-
plugins: {
|
11
|
-
"@stylistic": Plugin,
|
12
|
-
"@typescript-eslint": Plugin,
|
13
|
-
mocha: Plugin,
|
14
|
-
"chai-friendly": Plugin,
|
15
|
-
"chai-expect": Plugin,
|
16
|
-
"@html-eslint": Plugin,
|
17
|
-
css: Plugin,
|
18
|
-
json: Plugin,
|
19
|
-
jsonc: Plugin,
|
20
|
-
yml: Plugin,
|
21
|
-
},
|
22
|
-
parsers: {
|
23
|
-
ts: Parser("TS"),
|
24
|
-
html: Parser("HTML"),
|
25
|
-
yml: Parser("YML"),
|
26
|
-
},
|
27
|
-
},
|
28
|
-
},
|
29
|
-
configuration: {
|
30
|
-
settings: {
|
31
|
-
global: {
|
32
|
-
ecmaVersion: 2024,
|
33
|
-
sourceType: "module",
|
34
|
-
noInlineConfig: true,
|
35
|
-
reportUnusedDisableDirectives: "error",
|
36
|
-
} as const,
|
37
|
-
registry: {
|
38
|
-
js: {
|
39
|
-
languageOptions: {},
|
40
|
-
parserOptions: {},
|
41
|
-
},
|
42
|
-
ts: {
|
43
|
-
languageOptions: {
|
44
|
-
parser: "ts" as const,
|
45
|
-
},
|
46
|
-
parserOptions: {},
|
47
|
-
},
|
48
|
-
mocha: {
|
49
|
-
languageOptions: {
|
50
|
-
globals: "mocha" as const,
|
51
|
-
},
|
52
|
-
parserOptions: {},
|
53
|
-
},
|
54
|
-
svelte: {
|
55
|
-
languageOptions: {
|
56
|
-
parser: "svelte" as const,
|
57
|
-
},
|
58
|
-
parserOptions: {
|
59
|
-
parser: "ts" as const,
|
60
|
-
extraFileExtensions: [".svelte"],
|
61
|
-
},
|
62
|
-
processor: "svelte/svelte",
|
63
|
-
},
|
64
|
-
html: {
|
65
|
-
languageOptions: {
|
66
|
-
parser: "html" as const,
|
67
|
-
},
|
68
|
-
parserOptions: {
|
69
|
-
frontmatter: true,
|
70
|
-
},
|
71
|
-
language: "@html-eslint/html",
|
72
|
-
},
|
73
|
-
css: {
|
74
|
-
languageOptions: {
|
75
|
-
tolerant: false,
|
76
|
-
},
|
77
|
-
parserOptions: {},
|
78
|
-
language: "css/css",
|
79
|
-
},
|
80
|
-
json: {
|
81
|
-
languageOptions: {
|
82
|
-
allowTrailingCommas: true,
|
83
|
-
},
|
84
|
-
parserOptions: {},
|
85
|
-
language: "json/jsonc",
|
86
|
-
},
|
87
|
-
jsonc: {
|
88
|
-
languageOptions: {},
|
89
|
-
parserOptions: {},
|
90
|
-
language: "json/jsonc",
|
91
|
-
},
|
92
|
-
jsoncc: {
|
93
|
-
languageOptions: {},
|
94
|
-
parserOptions: {},
|
95
|
-
language: "json/jsonc",
|
96
|
-
},
|
97
|
-
yml: {
|
98
|
-
languageOptions: {
|
99
|
-
parser: "yml" as const,
|
100
|
-
},
|
101
|
-
parserOptions: {},
|
102
|
-
},
|
103
|
-
},
|
104
|
-
},
|
105
|
-
defaults: {
|
106
|
-
files: {
|
107
|
-
js: ["default.js"],
|
108
|
-
ts: ["default.ts"],
|
109
|
-
mocha: ["default.mocha"],
|
110
|
-
svelte: ["default.svelte"],
|
111
|
-
html: ["default.html"],
|
112
|
-
css: ["default.css"],
|
113
|
-
json: ["default.json"],
|
114
|
-
jsonc: ["default.jsonc"],
|
115
|
-
jsoncc: ["default-comma.jsonc"],
|
116
|
-
yml: ["default.yml"],
|
117
|
-
},
|
118
|
-
ignores: {
|
119
|
-
"*": ["ignore/default.*"],
|
120
|
-
js: ["ignore/default.js"],
|
121
|
-
ts: ["ignore/default.ts"],
|
122
|
-
mocha: ["ignore/default.mocha"],
|
123
|
-
svelte: ["ignore/default.svelte"],
|
124
|
-
html: ["ignore/default.html"],
|
125
|
-
css: ["ignore/default.css"],
|
126
|
-
json: ["ignore/default.json"],
|
127
|
-
jsonc: ["ignore/default.jsonc"],
|
128
|
-
jsoncc: ["ignore/default-comma.jsonc"],
|
129
|
-
yml: ["ignore/default.yml"],
|
130
|
-
},
|
131
|
-
rules: {
|
132
|
-
js: [
|
133
|
-
{
|
134
|
-
id: "enable",
|
135
|
-
rules: {
|
136
|
-
vanilla: ERROR,
|
137
|
-
vanilla0: ERROR,
|
138
|
-
vanilla1: ERROR,
|
139
|
-
vanilla2: ERROR,
|
140
|
-
} as const,
|
141
|
-
},
|
142
|
-
{
|
143
|
-
id: "enable/stylistic",
|
144
|
-
rules: {
|
145
|
-
"@stylistic/style-rule": ERROR,
|
146
|
-
} as const,
|
147
|
-
},
|
148
|
-
],
|
149
|
-
ts: [
|
150
|
-
{
|
151
|
-
id: "disable",
|
152
|
-
rules: {
|
153
|
-
vanilla0: OFF,
|
154
|
-
} as const,
|
155
|
-
},
|
156
|
-
{
|
157
|
-
id: "enable/extension",
|
158
|
-
rules: {
|
159
|
-
"@typescript-eslint/enums": ERROR,
|
160
|
-
"@typescript-eslint/destructure-expression": ERROR,
|
161
|
-
"@typescript-eslint/global": ERROR,
|
162
|
-
} as const,
|
163
|
-
},
|
164
|
-
],
|
165
|
-
mocha: [
|
166
|
-
{
|
167
|
-
id: "disable",
|
168
|
-
rules: {
|
169
|
-
vanilla2: OFF,
|
170
|
-
} as const,
|
171
|
-
},
|
172
|
-
{
|
173
|
-
id: "disable/ts",
|
174
|
-
rules: {
|
175
|
-
"@typescript-eslint/global": ERROR,
|
176
|
-
} as const,
|
177
|
-
},
|
178
|
-
{
|
179
|
-
id: "enable",
|
180
|
-
rules: {
|
181
|
-
"mocha/test-expression": ERROR,
|
182
|
-
} as const,
|
183
|
-
},
|
184
|
-
],
|
185
|
-
svelte: [
|
186
|
-
{
|
187
|
-
id: "disable",
|
188
|
-
rules: {
|
189
|
-
vanilla1: OFF,
|
190
|
-
} as const,
|
191
|
-
},
|
192
|
-
{
|
193
|
-
id: "enable-extension",
|
194
|
-
rules: {
|
195
|
-
"svelte/tags": ERROR,
|
196
|
-
} as const,
|
197
|
-
},
|
198
|
-
],
|
199
|
-
html: [
|
200
|
-
{
|
201
|
-
id: "enable",
|
202
|
-
rules: {
|
203
|
-
"html/attribute": ERROR,
|
204
|
-
} as const,
|
205
|
-
},
|
206
|
-
],
|
207
|
-
css: [
|
208
|
-
{
|
209
|
-
id: "enable",
|
210
|
-
rules: {
|
211
|
-
"css/property": ERROR,
|
212
|
-
} as const,
|
213
|
-
},
|
214
|
-
],
|
215
|
-
json: [
|
216
|
-
{
|
217
|
-
id: "enable",
|
218
|
-
rules: {
|
219
|
-
"jsonc/property-check": ERROR,
|
220
|
-
"jsonc/comment": [
|
221
|
-
ERROR,
|
222
|
-
"never",
|
223
|
-
],
|
224
|
-
"jsonc/trailing-comma": [
|
225
|
-
ERROR,
|
226
|
-
"never",
|
227
|
-
],
|
228
|
-
} as const,
|
229
|
-
},
|
230
|
-
],
|
231
|
-
jsonc: [
|
232
|
-
{
|
233
|
-
id: "override-comment",
|
234
|
-
rules: {
|
235
|
-
"jsonc/comment": [
|
236
|
-
ERROR,
|
237
|
-
"allow",
|
238
|
-
],
|
239
|
-
} as const,
|
240
|
-
},
|
241
|
-
],
|
242
|
-
jsoncc: [
|
243
|
-
{
|
244
|
-
id: "override-comma",
|
245
|
-
rules: {
|
246
|
-
"jsonc/trailing-comma": [
|
247
|
-
ERROR,
|
248
|
-
"allow",
|
249
|
-
],
|
250
|
-
} as const,
|
251
|
-
},
|
252
|
-
],
|
253
|
-
yml: [
|
254
|
-
{
|
255
|
-
id: "enable",
|
256
|
-
rules: {
|
257
|
-
"yml/property-check": ERROR,
|
258
|
-
} as const,
|
259
|
-
},
|
260
|
-
],
|
261
|
-
},
|
262
|
-
},
|
263
|
-
extensions: {},
|
264
|
-
attachments: [],
|
265
|
-
},
|
266
|
-
};
|
1
|
+
const
|
2
|
+
ERROR = "error",
|
3
|
+
OFF = "off",
|
4
|
+
Plugin = "MOCK_PLUGIN",
|
5
|
+
Parser = (scope: string) => `MOCK_PARSER:${scope}`;
|
6
|
+
|
7
|
+
export const TEST_INPUT = {
|
8
|
+
imports: {
|
9
|
+
required: {
|
10
|
+
plugins: {
|
11
|
+
"@stylistic": Plugin,
|
12
|
+
"@typescript-eslint": Plugin,
|
13
|
+
mocha: Plugin,
|
14
|
+
"chai-friendly": Plugin,
|
15
|
+
"chai-expect": Plugin,
|
16
|
+
"@html-eslint": Plugin,
|
17
|
+
css: Plugin,
|
18
|
+
json: Plugin,
|
19
|
+
jsonc: Plugin,
|
20
|
+
yml: Plugin,
|
21
|
+
},
|
22
|
+
parsers: {
|
23
|
+
ts: Parser("TS"),
|
24
|
+
html: Parser("HTML"),
|
25
|
+
yml: Parser("YML"),
|
26
|
+
},
|
27
|
+
},
|
28
|
+
},
|
29
|
+
configuration: {
|
30
|
+
settings: {
|
31
|
+
global: {
|
32
|
+
ecmaVersion: 2024,
|
33
|
+
sourceType: "module",
|
34
|
+
noInlineConfig: true,
|
35
|
+
reportUnusedDisableDirectives: "error",
|
36
|
+
} as const,
|
37
|
+
registry: {
|
38
|
+
js: {
|
39
|
+
languageOptions: {},
|
40
|
+
parserOptions: {},
|
41
|
+
},
|
42
|
+
ts: {
|
43
|
+
languageOptions: {
|
44
|
+
parser: "ts" as const,
|
45
|
+
},
|
46
|
+
parserOptions: {},
|
47
|
+
},
|
48
|
+
mocha: {
|
49
|
+
languageOptions: {
|
50
|
+
globals: "mocha" as const,
|
51
|
+
},
|
52
|
+
parserOptions: {},
|
53
|
+
},
|
54
|
+
svelte: {
|
55
|
+
languageOptions: {
|
56
|
+
parser: "svelte" as const,
|
57
|
+
},
|
58
|
+
parserOptions: {
|
59
|
+
parser: "ts" as const,
|
60
|
+
extraFileExtensions: [".svelte"],
|
61
|
+
},
|
62
|
+
processor: "svelte/svelte",
|
63
|
+
},
|
64
|
+
html: {
|
65
|
+
languageOptions: {
|
66
|
+
parser: "html" as const,
|
67
|
+
},
|
68
|
+
parserOptions: {
|
69
|
+
frontmatter: true,
|
70
|
+
},
|
71
|
+
language: "@html-eslint/html",
|
72
|
+
},
|
73
|
+
css: {
|
74
|
+
languageOptions: {
|
75
|
+
tolerant: false,
|
76
|
+
},
|
77
|
+
parserOptions: {},
|
78
|
+
language: "css/css",
|
79
|
+
},
|
80
|
+
json: {
|
81
|
+
languageOptions: {
|
82
|
+
allowTrailingCommas: true,
|
83
|
+
},
|
84
|
+
parserOptions: {},
|
85
|
+
language: "json/jsonc",
|
86
|
+
},
|
87
|
+
jsonc: {
|
88
|
+
languageOptions: {},
|
89
|
+
parserOptions: {},
|
90
|
+
language: "json/jsonc",
|
91
|
+
},
|
92
|
+
jsoncc: {
|
93
|
+
languageOptions: {},
|
94
|
+
parserOptions: {},
|
95
|
+
language: "json/jsonc",
|
96
|
+
},
|
97
|
+
yml: {
|
98
|
+
languageOptions: {
|
99
|
+
parser: "yml" as const,
|
100
|
+
},
|
101
|
+
parserOptions: {},
|
102
|
+
},
|
103
|
+
},
|
104
|
+
},
|
105
|
+
defaults: {
|
106
|
+
files: {
|
107
|
+
js: ["default.js"],
|
108
|
+
ts: ["default.ts"],
|
109
|
+
mocha: ["default.mocha"],
|
110
|
+
svelte: ["default.svelte"],
|
111
|
+
html: ["default.html"],
|
112
|
+
css: ["default.css"],
|
113
|
+
json: ["default.json"],
|
114
|
+
jsonc: ["default.jsonc"],
|
115
|
+
jsoncc: ["default-comma.jsonc"],
|
116
|
+
yml: ["default.yml"],
|
117
|
+
},
|
118
|
+
ignores: {
|
119
|
+
"*": ["ignore/default.*"],
|
120
|
+
js: ["ignore/default.js"],
|
121
|
+
ts: ["ignore/default.ts"],
|
122
|
+
mocha: ["ignore/default.mocha"],
|
123
|
+
svelte: ["ignore/default.svelte"],
|
124
|
+
html: ["ignore/default.html"],
|
125
|
+
css: ["ignore/default.css"],
|
126
|
+
json: ["ignore/default.json"],
|
127
|
+
jsonc: ["ignore/default.jsonc"],
|
128
|
+
jsoncc: ["ignore/default-comma.jsonc"],
|
129
|
+
yml: ["ignore/default.yml"],
|
130
|
+
},
|
131
|
+
rules: {
|
132
|
+
js: [
|
133
|
+
{
|
134
|
+
id: "enable",
|
135
|
+
rules: {
|
136
|
+
vanilla: ERROR,
|
137
|
+
vanilla0: ERROR,
|
138
|
+
vanilla1: ERROR,
|
139
|
+
vanilla2: ERROR,
|
140
|
+
} as const,
|
141
|
+
},
|
142
|
+
{
|
143
|
+
id: "enable/stylistic",
|
144
|
+
rules: {
|
145
|
+
"@stylistic/style-rule": ERROR,
|
146
|
+
} as const,
|
147
|
+
},
|
148
|
+
],
|
149
|
+
ts: [
|
150
|
+
{
|
151
|
+
id: "disable",
|
152
|
+
rules: {
|
153
|
+
vanilla0: OFF,
|
154
|
+
} as const,
|
155
|
+
},
|
156
|
+
{
|
157
|
+
id: "enable/extension",
|
158
|
+
rules: {
|
159
|
+
"@typescript-eslint/enums": ERROR,
|
160
|
+
"@typescript-eslint/destructure-expression": ERROR,
|
161
|
+
"@typescript-eslint/global": ERROR,
|
162
|
+
} as const,
|
163
|
+
},
|
164
|
+
],
|
165
|
+
mocha: [
|
166
|
+
{
|
167
|
+
id: "disable",
|
168
|
+
rules: {
|
169
|
+
vanilla2: OFF,
|
170
|
+
} as const,
|
171
|
+
},
|
172
|
+
{
|
173
|
+
id: "disable/ts",
|
174
|
+
rules: {
|
175
|
+
"@typescript-eslint/global": ERROR,
|
176
|
+
} as const,
|
177
|
+
},
|
178
|
+
{
|
179
|
+
id: "enable",
|
180
|
+
rules: {
|
181
|
+
"mocha/test-expression": ERROR,
|
182
|
+
} as const,
|
183
|
+
},
|
184
|
+
],
|
185
|
+
svelte: [
|
186
|
+
{
|
187
|
+
id: "disable",
|
188
|
+
rules: {
|
189
|
+
vanilla1: OFF,
|
190
|
+
} as const,
|
191
|
+
},
|
192
|
+
{
|
193
|
+
id: "enable-extension",
|
194
|
+
rules: {
|
195
|
+
"svelte/tags": ERROR,
|
196
|
+
} as const,
|
197
|
+
},
|
198
|
+
],
|
199
|
+
html: [
|
200
|
+
{
|
201
|
+
id: "enable",
|
202
|
+
rules: {
|
203
|
+
"html/attribute": ERROR,
|
204
|
+
} as const,
|
205
|
+
},
|
206
|
+
],
|
207
|
+
css: [
|
208
|
+
{
|
209
|
+
id: "enable",
|
210
|
+
rules: {
|
211
|
+
"css/property": ERROR,
|
212
|
+
} as const,
|
213
|
+
},
|
214
|
+
],
|
215
|
+
json: [
|
216
|
+
{
|
217
|
+
id: "enable",
|
218
|
+
rules: {
|
219
|
+
"jsonc/property-check": ERROR,
|
220
|
+
"jsonc/comment": [
|
221
|
+
ERROR,
|
222
|
+
"never",
|
223
|
+
],
|
224
|
+
"jsonc/trailing-comma": [
|
225
|
+
ERROR,
|
226
|
+
"never",
|
227
|
+
],
|
228
|
+
} as const,
|
229
|
+
},
|
230
|
+
],
|
231
|
+
jsonc: [
|
232
|
+
{
|
233
|
+
id: "override-comment",
|
234
|
+
rules: {
|
235
|
+
"jsonc/comment": [
|
236
|
+
ERROR,
|
237
|
+
"allow",
|
238
|
+
],
|
239
|
+
} as const,
|
240
|
+
},
|
241
|
+
],
|
242
|
+
jsoncc: [
|
243
|
+
{
|
244
|
+
id: "override-comma",
|
245
|
+
rules: {
|
246
|
+
"jsonc/trailing-comma": [
|
247
|
+
ERROR,
|
248
|
+
"allow",
|
249
|
+
],
|
250
|
+
} as const,
|
251
|
+
},
|
252
|
+
],
|
253
|
+
yml: [
|
254
|
+
{
|
255
|
+
id: "enable",
|
256
|
+
rules: {
|
257
|
+
"yml/property-check": ERROR,
|
258
|
+
} as const,
|
259
|
+
},
|
260
|
+
],
|
261
|
+
},
|
262
|
+
},
|
263
|
+
extensions: {},
|
264
|
+
attachments: [],
|
265
|
+
},
|
266
|
+
};
|