@eslinted/core 29.4.5 → 29.4.7
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.d.ts.map +1 -1
- package/dist/factory.js +28 -38
- package/dist/factory.js.map +1 -1
- package/package.json +1 -1
- package/src/factory.ts +52 -57
- package/src/tsconfig.json +1 -0
- package/tests/tsconfig.json +1 -0
package/dist/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,IAAI,MAAM,GAAG,CAAC;AAG1B,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,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,EA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EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,6CAsIvF"}
|
package/dist/factory.js
CHANGED
|
@@ -1,51 +1,42 @@
|
|
|
1
1
|
import { defineConfig, globalIgnores, } from "@eslint/config-helpers";
|
|
2
2
|
export default function factory(scopes, optional, tree, { plugins, parsers, }, settings, { defaults, extensions = {}, }) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
const Scopes = new Set(scopes), OptionalScopes = new Set(optional), RequiredScopes = Scopes.difference(OptionalScopes), ExtendedScopes = new Set(Object.keys(extensions))
|
|
4
|
+
.intersection(Scopes), ExtendedOptionalScopes = ExtendedScopes
|
|
5
|
+
.intersection(OptionalScopes), ConfiguredScopes = RequiredScopes
|
|
6
|
+
.union(ExtendedOptionalScopes);
|
|
7
|
+
for (const scope of ExtendedOptionalScopes) {
|
|
8
|
+
plugins[scope] = extensions[scope].plugin;
|
|
9
|
+
parsers[scope] = extensions[scope].parser;
|
|
10
|
+
}
|
|
11
|
+
for (const scope of ExtendedScopes) {
|
|
10
12
|
const { [scope]: { files, ignores, rules, } = {}, } = extensions;
|
|
11
13
|
if (files !== undefined)
|
|
12
|
-
void defaults
|
|
13
|
-
.files[scope]
|
|
14
|
-
.push(...files);
|
|
14
|
+
void defaults.files[scope].push(...files);
|
|
15
15
|
if (ignores !== undefined)
|
|
16
16
|
if (defaults.ignores[scope] === undefined)
|
|
17
17
|
defaults.ignores[scope] = ignores;
|
|
18
18
|
else
|
|
19
|
-
void defaults
|
|
20
|
-
.ignores[scope]
|
|
21
|
-
.push(...ignores);
|
|
19
|
+
void defaults.ignores[scope].push(...ignores);
|
|
22
20
|
if (rules !== undefined)
|
|
23
21
|
defaults.rules[scope][defaults.rules[scope].length] = { rules };
|
|
24
22
|
}
|
|
25
23
|
for (const [scope, parents] of tree)
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.files[parent]
|
|
31
|
-
.push(...defaults.files[scope]);
|
|
24
|
+
if (ConfiguredScopes.has(scope)
|
|
25
|
+
&& defaults.files[scope].length !== 0)
|
|
26
|
+
for (const parent of parents)
|
|
27
|
+
void defaults.files[parent].push(...defaults.files[scope]);
|
|
32
28
|
if (extensions["*"] !== undefined)
|
|
33
29
|
if (extensions["*"].override === true
|
|
34
30
|
|| defaults.ignores["*"] === undefined)
|
|
35
31
|
defaults.ignores["*"] = extensions["*"].ignores ?? [];
|
|
36
|
-
else if (extensions["*"].ignores !== undefined
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return defineConfig({
|
|
45
|
-
plugins,
|
|
46
|
-
}, defaults.ignores["*"] === undefined
|
|
47
|
-
? []
|
|
48
|
-
: globalIgnores(defaults.ignores["*"]), active
|
|
32
|
+
else if (extensions["*"].ignores !== undefined
|
|
33
|
+
&& extensions["*"].ignores.length !== 0)
|
|
34
|
+
void defaults.ignores["*"].push(...extensions["*"].ignores);
|
|
35
|
+
const enabledScopes = scopes
|
|
36
|
+
.filter(scope => ConfiguredScopes.has(scope))
|
|
37
|
+
.filter(scope => defaults.files[scope].length !== 0)
|
|
38
|
+
.filter(scope => defaults.rules[scope].length !== 0);
|
|
39
|
+
return defineConfig({ plugins }, globalIgnores(defaults.ignores["*"] ?? []), enabledScopes
|
|
49
40
|
.filter(scope => settings[scope] !== undefined)
|
|
50
41
|
.map(scope => {
|
|
51
42
|
const { languageOptions, parserOptions, processor, language, } = settings[scope];
|
|
@@ -73,12 +64,11 @@ export default function factory(scopes, optional, tree, { plugins, parsers, }, s
|
|
|
73
64
|
return {
|
|
74
65
|
files: defaults.files[scope],
|
|
75
66
|
ignores: defaults.ignores[scope] ?? [],
|
|
76
|
-
"extends": [
|
|
67
|
+
"extends": [
|
|
68
|
+
definition,
|
|
69
|
+
defaults.rules[scope],
|
|
70
|
+
],
|
|
77
71
|
};
|
|
78
|
-
})
|
|
79
|
-
files: defaults.files[scope],
|
|
80
|
-
ignores: defaults.ignores[scope] ?? [],
|
|
81
|
-
"extends": [defaults.rules[scope]],
|
|
82
|
-
})));
|
|
72
|
+
}));
|
|
83
73
|
}
|
|
84
74
|
//# sourceMappingURL=factory.js.map
|
package/dist/factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,GACd,MAAM,wBAAwB,CAAC;AAIhC,MAAM,CAAC,OAAO,UAAU,OAAO,CAO7B,MAA2F,EAC3F,QAA6F,EAC7F,IAAyF,EACzF,EACE,OAAO,EACP,OAAO,GAC6E,EACtF,QAA6F,EAC7F,EACE,QAAQ,EACR,UAAU,GAAG,EAAE,GACqE;IAEtF,
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,GACd,MAAM,wBAAwB,CAAC;AAIhC,MAAM,CAAC,OAAO,UAAU,OAAO,CAO7B,MAA2F,EAC3F,QAA6F,EAC7F,IAAyF,EACzF,EACE,OAAO,EACP,OAAO,GAC6E,EACtF,QAA6F,EAC7F,EACE,QAAQ,EACR,UAAU,GAAG,EAAE,GACqE;IAEtF,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,EAC9B,cAAc,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,EAClC,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,EAClD,cAAc,GAAG,IAAI,GAAG,CACtB,MAAM,CAAC,IAAI,CAAC,UAAU,CAAY,CACnC;SACE,YAAY,CAAC,MAAM,CAAC,EACvB,sBAAsB,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-npm/package-json",
|
|
5
5
|
"name": "@eslinted/core",
|
|
6
|
-
"version": "29.4.
|
|
6
|
+
"version": "29.4.7",
|
|
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.ts
CHANGED
|
@@ -25,23 +25,25 @@ export default function factory<
|
|
|
25
25
|
extensions = {},
|
|
26
26
|
}: Parameters<typeof Core<Scope, Optional, RequiredPlugin, RequiredParser, Parser>>[5],
|
|
27
27
|
) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
const Scopes = new Set(scopes),
|
|
29
|
+
OptionalScopes = new Set(optional),
|
|
30
|
+
RequiredScopes = Scopes.difference(OptionalScopes),
|
|
31
|
+
ExtendedScopes = new Set(
|
|
32
|
+
Object.keys(extensions) as Scope[],
|
|
33
|
+
)
|
|
34
|
+
.intersection(Scopes),
|
|
35
|
+
ExtendedOptionalScopes = ExtendedScopes
|
|
36
|
+
.intersection(OptionalScopes),
|
|
37
|
+
ConfiguredScopes = RequiredScopes
|
|
38
|
+
.union(ExtendedOptionalScopes);
|
|
39
|
+
|
|
40
|
+
for (const scope of ExtendedOptionalScopes) {
|
|
41
|
+
/* eslint-disable no-param-reassign */
|
|
42
|
+
plugins[scope] = extensions[scope]!.plugin as typeof plugins[Optional];
|
|
43
|
+
parsers[scope] = extensions[scope]!.parser as typeof parsers[Optional];
|
|
44
|
+
}
|
|
43
45
|
|
|
44
|
-
for (const scope of
|
|
46
|
+
for (const scope of ExtendedScopes) {
|
|
45
47
|
const {
|
|
46
48
|
[scope]: {
|
|
47
49
|
files,
|
|
@@ -51,18 +53,18 @@ export default function factory<
|
|
|
51
53
|
} = extensions;
|
|
52
54
|
|
|
53
55
|
if (files !== undefined)
|
|
54
|
-
void defaults
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
void defaults.files[scope].push(
|
|
57
|
+
...files,
|
|
58
|
+
);
|
|
57
59
|
|
|
58
60
|
if (ignores !== undefined)
|
|
59
61
|
if (defaults.ignores[scope] === undefined)
|
|
60
62
|
/* eslint-disable no-param-reassign */
|
|
61
63
|
defaults.ignores[scope] = ignores;
|
|
62
64
|
else
|
|
63
|
-
void defaults
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
void defaults.ignores[scope].push(
|
|
66
|
+
...ignores,
|
|
67
|
+
);
|
|
66
68
|
|
|
67
69
|
if (rules !== undefined)
|
|
68
70
|
/* eslint-disable no-param-reassign */
|
|
@@ -72,12 +74,14 @@ export default function factory<
|
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
for (const [scope, parents] of tree)
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
if (
|
|
78
|
+
ConfiguredScopes.has(scope)
|
|
79
|
+
&& defaults.files[scope].length !== 0
|
|
80
|
+
)
|
|
81
|
+
for (const parent of parents)
|
|
82
|
+
void defaults.files[parent].push(
|
|
83
|
+
...defaults.files[scope],
|
|
84
|
+
);
|
|
81
85
|
|
|
82
86
|
if (extensions["*"] !== undefined)
|
|
83
87
|
if (
|
|
@@ -86,29 +90,24 @@ export default function factory<
|
|
|
86
90
|
)
|
|
87
91
|
defaults.ignores["*"] = extensions["*"].ignores ?? [];
|
|
88
92
|
else
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
if (
|
|
94
|
+
extensions["*"].ignores !== undefined
|
|
95
|
+
&& extensions["*"].ignores.length !== 0
|
|
96
|
+
)
|
|
97
|
+
void defaults.ignores["*"].push(
|
|
98
|
+
...extensions["*"].ignores,
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
const enabledScopes = scopes
|
|
102
|
+
.filter(scope => ConfiguredScopes.has(scope))
|
|
103
|
+
.filter(scope => defaults.files[scope].length !== 0)
|
|
104
|
+
.filter(scope => defaults.rules[scope].length !== 0);
|
|
100
105
|
|
|
101
106
|
return defineConfig(
|
|
102
|
-
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
? []
|
|
107
|
-
: globalIgnores(defaults.ignores["*"]),
|
|
108
|
-
active
|
|
109
|
-
.filter(
|
|
110
|
-
scope => settings[scope] !== undefined,
|
|
111
|
-
)
|
|
107
|
+
{ plugins },
|
|
108
|
+
globalIgnores(defaults.ignores["*"] ?? []),
|
|
109
|
+
enabledScopes
|
|
110
|
+
.filter(scope => settings[scope] !== undefined)
|
|
112
111
|
.map(
|
|
113
112
|
scope => {
|
|
114
113
|
const {
|
|
@@ -150,16 +149,12 @@ export default function factory<
|
|
|
150
149
|
return {
|
|
151
150
|
files: defaults.files[scope],
|
|
152
151
|
ignores: defaults.ignores[scope] ?? [],
|
|
153
|
-
"extends": [
|
|
152
|
+
"extends": [
|
|
153
|
+
definition,
|
|
154
|
+
defaults.rules[scope] as MutableRuleConfigs<NonNullable<typeof defaults.rules[typeof scope]>>,
|
|
155
|
+
],
|
|
154
156
|
};
|
|
155
157
|
},
|
|
156
158
|
),
|
|
157
|
-
active.map(
|
|
158
|
-
scope => ({
|
|
159
|
-
files: defaults.files[scope],
|
|
160
|
-
ignores: defaults.ignores[scope] ?? [],
|
|
161
|
-
"extends": [defaults.rules[scope] as MutableRuleConfigs<NonNullable<typeof defaults.rules[typeof scope]>>],
|
|
162
|
-
}),
|
|
163
|
-
),
|
|
164
159
|
);
|
|
165
160
|
}
|
package/src/tsconfig.json
CHANGED