@eslinted/core 29.0.0-rc.1 → 29.0.0-rc.3
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.map +1 -1
- package/dist/factory/index.js +18 -26
- package/dist/factory/index.js.map +1 -1
- package/dist/interface/configuration/defaults/index.d.ts +1 -1
- package/dist/interface/configuration/defaults/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/factory/index.ts +23 -39
- package/src/interface/configuration/defaults/index.ts +3 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,IAAI,MAAM,IAAI,CAAC;AAuB3B,MAAM,CAAC,OAAO,UAAU,OAAO,CAC7B,KAAK,SAAS,MAAM,EACpB,QAAQ,SAAS,KAAK,EACtB,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,KAAK,EAC5B,MAAM,SAAS,cAAc,GAAG,QAAQ,EAExC,MAAM,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAC3F,QAAQ,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAC7F,IAAI,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EACzF,EACE,OAAO,EACP,OAAO,GACR,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EACtF,QAAQ,EAAE,UAAU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C,CAAC,CAAC,CAAC,CAAC,EAC7F,EACE,QAAQ,EACR,UAAe,GAChB,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,6CAgNvF"}
|
package/dist/factory/index.js
CHANGED
|
@@ -12,15 +12,12 @@ export default function factory(scopes, optional, tree, { plugins, parsers, }, s
|
|
|
12
12
|
for (const scope of scopes)
|
|
13
13
|
if (extensions[scope] !== undefined) {
|
|
14
14
|
const { [scope]: { files = [], ignores = [], rules = null, } = {}, } = extensions;
|
|
15
|
-
if (files.length !== 0)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for (let i = 0; i < files.length; i++)
|
|
22
|
-
defaultFiles[L + i] = files[i];
|
|
23
|
-
}
|
|
15
|
+
if (files.length !== 0) {
|
|
16
|
+
const defaultFiles = defaults.files[scope], L = defaultFiles.length;
|
|
17
|
+
defaultFiles.length += files.length;
|
|
18
|
+
for (let i = 0; i < files.length; i++)
|
|
19
|
+
defaultFiles[L + i] = files[i];
|
|
20
|
+
}
|
|
24
21
|
if (ignores.length !== 0)
|
|
25
22
|
if (defaults.ignores[scope] === undefined)
|
|
26
23
|
Object.assign(defaults.ignores, { [scope]: ignores });
|
|
@@ -51,17 +48,13 @@ export default function factory(scopes, optional, tree, { plugins, parsers, }, s
|
|
|
51
48
|
if (!Optional.has(scope)
|
|
52
49
|
|| scope in parsers) {
|
|
53
50
|
const files = defaults.files[scope], ignores = defaults.ignores[scope];
|
|
54
|
-
if (files !==
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
parentFiles.length += files.length;
|
|
62
|
-
for (let i = 0; i < files.length; i++)
|
|
63
|
-
parentFiles[L + i] = files[i];
|
|
64
|
-
}
|
|
51
|
+
if (files.length !== 0)
|
|
52
|
+
for (const parent of parents) {
|
|
53
|
+
const parentFiles = defaults.files[parent], L = parentFiles.length;
|
|
54
|
+
parentFiles.length += files.length;
|
|
55
|
+
for (let i = 0; i < files.length; i++)
|
|
56
|
+
parentFiles[L + i] = files[i];
|
|
57
|
+
}
|
|
65
58
|
if (ignores !== undefined)
|
|
66
59
|
if (ignores.length !== 0)
|
|
67
60
|
for (const parent of parents)
|
|
@@ -84,13 +77,12 @@ export default function factory(scopes, optional, tree, { plugins, parsers, }, s
|
|
|
84
77
|
for (let i = 0; i < ignores.length; i++)
|
|
85
78
|
defaultGlobals[L + i] = ignores[i];
|
|
86
79
|
}
|
|
87
|
-
return defineConfig(
|
|
80
|
+
return defineConfig({
|
|
88
81
|
name: "plugins",
|
|
89
82
|
plugins,
|
|
90
|
-
}, scopes.map(scope => {
|
|
83
|
+
}, globalIgnores(defaults.ignores["*"]), scopes.map(scope => {
|
|
91
84
|
const { files: { [scope]: files }, ignores: { [scope]: ignores = [] }, rules: { [scope]: rules }, } = defaults;
|
|
92
|
-
if (
|
|
93
|
-
|| rules === undefined
|
|
85
|
+
if (rules === undefined
|
|
94
86
|
|| files.length === 0
|
|
95
87
|
|| rules.length === 0
|
|
96
88
|
|| Optional.has(scope)
|
|
@@ -118,12 +110,12 @@ export default function factory(scopes, optional, tree, { plugins, parsers, }, s
|
|
|
118
110
|
Object.assign(definition, { language });
|
|
119
111
|
rules[rules.length] = definition;
|
|
120
112
|
}
|
|
121
|
-
return
|
|
113
|
+
return {
|
|
122
114
|
name: "scope/".concat(scope),
|
|
123
115
|
files,
|
|
124
116
|
ignores,
|
|
125
117
|
"extends": [rules],
|
|
126
|
-
}
|
|
118
|
+
};
|
|
127
119
|
}
|
|
128
120
|
}));
|
|
129
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,GAEd,MAAM,w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SAAS,EACT,QAAQ,GACT,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAEpB,IAAI,eAAe,EAAE,MAAM,KAAK,SAAS;oBACvC,eAAe,CAAC,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAW,CAAC;gBAErE,IAAI,aAAa,EAAE,MAAM,KAAK,SAAS;oBACrC,aAAa,CAAC,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAW,CAAC;gBAEjE,MAAM,UAAU,GAAG,eAAe,KAAK,SAAS;oBAC9C,CAAC,CAAC,aAAa,KAAK,SAAS;wBAC3B,CAAC,CAAC,EAAE;wBACJ,CAAC,CAAC;4BACE,eAAe,EAAE;gCACf,aAAa;6BACd;yBACF;oBACL,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC;gBAExB,IAAI,SAAS,KAAK,SAAS;oBACzB,MAAM,CAAC,MAAM,CACX,UAAU,EACV,EAAE,SAAS,EAAE,CACd,CAAC;gBAEJ,IAAI,QAAQ,KAAK,SAAS;oBACxB,MAAM,CAAC,MAAM,CACX,UAAU,EACV,EAAE,QAAQ,EAAE,CACb,CAAC;gBAEH,KAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC;YAClD,CAAC;YAED,OAAO;gBACL,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC5B,KAAK;gBACL,OAAO;gBACP,SAAS,EAAE,CAAC,KAAmC,CAAC;aACjD,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RuleConfig } from "@eslint/config-helpers";
|
|
2
2
|
export interface Defaults<Scope extends string> {
|
|
3
|
-
files:
|
|
3
|
+
files: Record<Scope, string[]>;
|
|
4
4
|
ignores: Record<"*", string[]> & Partial<Record<Scope, string[]>>;
|
|
5
5
|
rules: Partial<Record<Scope, Array<{
|
|
6
6
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/configuration/defaults/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,WAAW,QAAQ,CAAC,KAAK,SAAS,MAAM;IAC5C,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/configuration/defaults/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,WAAW,QAAQ,CAAC,KAAK,SAAS,MAAM;IAC5C,KAAK,EAAE,MAAM,CACX,KAAK,EACL,MAAM,EAAE,CACT,CAAC;IACF,OAAO,EACH,MAAM,CACN,GAAG,EACH,MAAM,EAAE,CACT,GACC,OAAO,CACP,MAAM,CACJ,KAAK,EACL,MAAM,EAAE,CACT,CACF,CAAC;IACJ,KAAK,EAAE,OAAO,CACZ,MAAM,CACJ,KAAK,EACL,KAAK,CACH;QACE,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CACX,MAAM,EACN,QAAQ,CAAC,UAAU,CAAC,CACrB,CAAC;KACH,CACF,CACF,CACF,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"$schema": "https://json.schemastore.org/package",
|
|
4
4
|
"$help": "https://docs.npmjs.com/cli/configuring-npm/package-json",
|
|
5
5
|
"name": "@eslinted/core",
|
|
6
|
-
"version": "29.0.0-rc.
|
|
6
|
+
"version": "29.0.0-rc.3",
|
|
7
7
|
"repository": "github:jimmy-zhening-luo/linted-core",
|
|
8
8
|
"description": "Internal core for npm package `linted`, responsible for producing an array of fully-formed ESLint configurations according to `linted` spec.",
|
|
9
9
|
"keywords": [],
|
package/src/factory/index.ts
CHANGED
|
@@ -72,21 +72,15 @@ export default function factory<
|
|
|
72
72
|
} = {},
|
|
73
73
|
} = extensions;
|
|
74
74
|
|
|
75
|
-
if (files.length !== 0)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
defaults.files,
|
|
79
|
-
{ [scope]: files },
|
|
80
|
-
);
|
|
81
|
-
else {
|
|
82
|
-
const defaultFiles = defaults.files[scope],
|
|
83
|
-
L = defaultFiles.length;
|
|
75
|
+
if (files.length !== 0) {
|
|
76
|
+
const defaultFiles = defaults.files[scope],
|
|
77
|
+
L = defaultFiles.length;
|
|
84
78
|
|
|
85
|
-
|
|
79
|
+
defaultFiles.length += files.length;
|
|
86
80
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
for (let i = 0; i < files.length; i++)
|
|
82
|
+
defaultFiles[L + i] = files[i]!;
|
|
83
|
+
}
|
|
90
84
|
|
|
91
85
|
if (ignores.length !== 0)
|
|
92
86
|
if (defaults.ignores[scope] === undefined)
|
|
@@ -137,23 +131,16 @@ export default function factory<
|
|
|
137
131
|
const files = defaults.files[scope],
|
|
138
132
|
ignores = defaults.ignores[scope];
|
|
139
133
|
|
|
140
|
-
if (files !==
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
Object.assign(
|
|
145
|
-
defaults.files,
|
|
146
|
-
{ [parent]: files },
|
|
147
|
-
);
|
|
148
|
-
else {
|
|
149
|
-
const parentFiles = defaults.files[parent],
|
|
150
|
-
L = parentFiles.length;
|
|
134
|
+
if (files.length !== 0)
|
|
135
|
+
for (const parent of parents) {
|
|
136
|
+
const parentFiles = defaults.files[parent],
|
|
137
|
+
L = parentFiles.length;
|
|
151
138
|
|
|
152
|
-
|
|
139
|
+
parentFiles.length += files.length;
|
|
153
140
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
141
|
+
for (let i = 0; i < files.length; i++)
|
|
142
|
+
parentFiles[L + i] = files[i]!;
|
|
143
|
+
}
|
|
157
144
|
|
|
158
145
|
if (ignores !== undefined)
|
|
159
146
|
if (ignores.length !== 0)
|
|
@@ -194,11 +181,11 @@ export default function factory<
|
|
|
194
181
|
}
|
|
195
182
|
|
|
196
183
|
return defineConfig(
|
|
197
|
-
globalIgnores(defaults.ignores["*"]),
|
|
198
184
|
{
|
|
199
185
|
name: "plugins",
|
|
200
186
|
plugins,
|
|
201
187
|
},
|
|
188
|
+
globalIgnores(defaults.ignores["*"]),
|
|
202
189
|
scopes.map(
|
|
203
190
|
scope => {
|
|
204
191
|
const {
|
|
@@ -208,8 +195,7 @@ export default function factory<
|
|
|
208
195
|
} = defaults;
|
|
209
196
|
|
|
210
197
|
if (
|
|
211
|
-
|
|
212
|
-
|| rules === undefined
|
|
198
|
+
rules === undefined
|
|
213
199
|
|| files.length === 0
|
|
214
200
|
|| rules.length === 0
|
|
215
201
|
|| Optional.has(scope)
|
|
@@ -256,14 +242,12 @@ export default function factory<
|
|
|
256
242
|
(rules as unknown[])[rules.length] = definition;
|
|
257
243
|
}
|
|
258
244
|
|
|
259
|
-
return
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
},
|
|
266
|
-
);
|
|
245
|
+
return {
|
|
246
|
+
name: "scope/".concat(scope),
|
|
247
|
+
files,
|
|
248
|
+
ignores,
|
|
249
|
+
"extends": [rules as MutableRules<typeof rules>],
|
|
250
|
+
};
|
|
267
251
|
}
|
|
268
252
|
},
|
|
269
253
|
),
|