@eslinted/core 32.0.1 → 32.0.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/index.d.ts +1 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tests/index.spec.js +4 -5
- package/dist/tests/index.spec.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -9
- package/tests/index.spec.ts +12 -7
- package/typings/defaults/index.d.ts +1 -1
- package/typings/extensions/scopes.d.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import type { Settings, Defaults, Extensions } from "../typings";
|
|
2
|
-
|
|
3
|
-
export default function <Scope extends string, Optional extends Scope>(scopes: readonly Scope[], optional: readonly Optional[], tree: Array<readonly [Scope, readonly Scope[]]>, parsers: Record<string, unknown>, settings: Settings<Scope>, defaults: Defaults<Scope>, extensions: Extensions<Scope, Optional>): Array<{
|
|
4
|
-
files?: Array<string | [string, string]>;
|
|
5
|
-
ignores?: string[];
|
|
6
|
-
rules?: Rules;
|
|
7
|
-
plugins?: Record<string, unknown>;
|
|
8
|
-
}>;
|
|
2
|
+
export default function <Scope extends string, Optional extends Scope>(scopes: readonly Scope[], optional: readonly Optional[], tree: Array<readonly [Scope, readonly Scope[]]>, parsers: Record<string, unknown>, settings: Settings<Scope>, defaults: Defaults<Scope>, extensions: Extensions<Scope, Optional>): unknown[];
|
|
9
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACX,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,OAAO,WACZ,KAAK,SAAS,MAAM,EACpB,QAAQ,SAAS,KAAK,EAEtB,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,QAAQ,EAAE,SAAS,QAAQ,EAAE,EAC7B,IAAI,EAAE,KAAK,CACT,SAAS,CAAC,KAAK,EAAE,SAAS,KAAK,EAAE,CAAC,CACnC,EACD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,EACzB,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,EACzB,UAAU,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,GACtC,OAAO,EAAE,CAUX"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAOhC,MAAM,CAAC,OAAO,WAIZ,MAAwB,EACxB,QAA6B,EAC7B,IAEC,EACD,OAAgC,EAChC,QAAyB,EACzB,QAAyB,EACzB,UAAuC;IAEvC,OAAO,OAAO,CACZ,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,UAAU,CACX,CAAC;AACJ,CAAC"}
|
package/dist/tests/index.spec.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "chai/register-should.js";
|
|
2
2
|
import Core from "../index.js";
|
|
3
3
|
import { scopes, optional, tree, imports, settings, defaults, extensions, } from "./index.input.spec.js";
|
|
4
|
-
const configs = Core(scopes, optional, tree, imports, settings, defaults, extensions), Scopes = new Set(scopes);
|
|
4
|
+
const GLOBAL_CONFIG_COUNT = 1, configs = Core(scopes, optional, tree, imports, settings, defaults, extensions), Scopes = new Set(scopes);
|
|
5
5
|
for (const scope of optional)
|
|
6
6
|
Scopes.delete(scope);
|
|
7
7
|
describe("Core", () => {
|
|
@@ -19,11 +19,11 @@ describe("Core", () => {
|
|
|
19
19
|
.an("array")
|
|
20
20
|
.not.empty;
|
|
21
21
|
});
|
|
22
|
-
it(`length >= (*/plugins + */ignores + ${Scopes.size} scopes = ${Scopes.size +
|
|
22
|
+
it(`length >= (*/plugins + */ignores + ${Scopes.size} scopes = ${Scopes.size + GLOBAL_CONFIG_COUNT}) [Actual: ${configs.length}]`, () => {
|
|
23
23
|
configs
|
|
24
24
|
.should.have
|
|
25
25
|
.lengthOf
|
|
26
|
-
.at.least(Scopes.size +
|
|
26
|
+
.at.least(Scopes.size + GLOBAL_CONFIG_COUNT);
|
|
27
27
|
});
|
|
28
28
|
it("of config objects", () => {
|
|
29
29
|
for (const config of configs)
|
|
@@ -44,8 +44,7 @@ describe("Core", () => {
|
|
|
44
44
|
it("or valid files", () => {
|
|
45
45
|
for (const config of configs)
|
|
46
46
|
if ("files" in config)
|
|
47
|
-
config
|
|
48
|
-
.files
|
|
47
|
+
config.files
|
|
49
48
|
.should.be
|
|
50
49
|
.an("array")
|
|
51
50
|
.not.empty;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../tests/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,IAAI,MAAM,IAAI,CAAC;AACtB,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,UAAU,GACX,MAAM,oBAAoB,CAAC;AAE5B,MAAM,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../tests/index.spec.ts"],"names":[],"mappings":"AAA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yBACT,EAAE,CAAC,QAAQ,CAAC;yBACZ,GAAG,CAAC,KAAK,CAAC;oBAEb,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;wBAC7C,IAAI;6BACD,MAAM;6BACN,EAAE;6BACF,CAAC,CAAC,QAAQ,CAAC,CAAC;wBAEf,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,QAAQ;4BACxC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAE;iCAChB,MAAM;iCACN,EAAE;iCACF,EAAE,CAAC,OAAO,CAAC;iCACX,IAAI;iCACJ,QAAQ,CAAC,GAAG,CAAC;iCACb,CAAC,CAAC,QAAQ,CAAC,CAAC;oBACnB,CAAC;gBACH,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CACF,CAAC"}
|
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": "32.0.
|
|
6
|
+
"version": "32.0.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/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type {
|
|
|
4
4
|
Defaults,
|
|
5
5
|
Extensions,
|
|
6
6
|
} from "../typings";
|
|
7
|
-
import type { Rules } from "../typings/rules";
|
|
8
7
|
|
|
9
8
|
export default function<
|
|
10
9
|
Scope extends string,
|
|
@@ -19,14 +18,7 @@ export default function<
|
|
|
19
18
|
settings: Settings<Scope>,
|
|
20
19
|
defaults: Defaults<Scope>,
|
|
21
20
|
extensions: Extensions<Scope, Optional>,
|
|
22
|
-
):
|
|
23
|
-
{
|
|
24
|
-
files?: Array<string | [string, string]>;
|
|
25
|
-
ignores?: string[];
|
|
26
|
-
rules?: Rules;
|
|
27
|
-
plugins?: Record<string, unknown>;
|
|
28
|
-
}
|
|
29
|
-
> {
|
|
21
|
+
): unknown[] {
|
|
30
22
|
return factory(
|
|
31
23
|
scopes,
|
|
32
24
|
optional,
|
package/tests/index.spec.ts
CHANGED
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
extensions,
|
|
11
11
|
} from "./index.input.spec";
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const GLOBAL_CONFIG_COUNT = 1,
|
|
14
|
+
configs = Core(
|
|
14
15
|
scopes,
|
|
15
16
|
optional,
|
|
16
17
|
tree,
|
|
@@ -18,7 +19,12 @@ const configs = Core(
|
|
|
18
19
|
settings,
|
|
19
20
|
defaults,
|
|
20
21
|
extensions,
|
|
21
|
-
)
|
|
22
|
+
) as {
|
|
23
|
+
files?: (string | string[])[];
|
|
24
|
+
ignores?: string[];
|
|
25
|
+
rules?: Record<string, unknown>;
|
|
26
|
+
plugins?: object;
|
|
27
|
+
}[],
|
|
22
28
|
Scopes = new Set(scopes);
|
|
23
29
|
|
|
24
30
|
for (const scope of optional)
|
|
@@ -53,12 +59,12 @@ describe(
|
|
|
53
59
|
},
|
|
54
60
|
);
|
|
55
61
|
it(
|
|
56
|
-
`length >= (*/plugins + */ignores + ${Scopes.size} scopes = ${Scopes.size +
|
|
62
|
+
`length >= (*/plugins + */ignores + ${Scopes.size} scopes = ${Scopes.size + GLOBAL_CONFIG_COUNT}) [Actual: ${configs.length}]`,
|
|
57
63
|
() => {
|
|
58
64
|
configs
|
|
59
65
|
.should.have
|
|
60
66
|
.lengthOf
|
|
61
|
-
.at.least(Scopes.size +
|
|
67
|
+
.at.least(Scopes.size + GLOBAL_CONFIG_COUNT);
|
|
62
68
|
},
|
|
63
69
|
);
|
|
64
70
|
it(
|
|
@@ -83,7 +89,7 @@ describe(
|
|
|
83
89
|
() => {
|
|
84
90
|
for (const config of configs)
|
|
85
91
|
if ("plugins" in config)
|
|
86
|
-
|
|
92
|
+
config.plugins
|
|
87
93
|
.should.be
|
|
88
94
|
.an("object");
|
|
89
95
|
},
|
|
@@ -93,8 +99,7 @@ describe(
|
|
|
93
99
|
() => {
|
|
94
100
|
for (const config of configs)
|
|
95
101
|
if ("files" in config)
|
|
96
|
-
config
|
|
97
|
-
.files
|
|
102
|
+
config.files
|
|
98
103
|
.should.be
|
|
99
104
|
.an("array")
|
|
100
105
|
.not.empty;
|