@eslinted/core 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +20 -20
package/dist/index.d.ts
CHANGED
@@ -7,7 +7,7 @@ export { default as Ruleset } from "./ruleset/Ruleset.js";
|
|
7
7
|
export { Rule } from "./ruleset/Ruleset.js";
|
8
8
|
export type { Scopes } from "./scopes.js";
|
9
9
|
export type { default as IConfig } from "./interface/IConfig.js";
|
10
|
-
export default function (plugins: Plugins, parsers: Parsers,
|
10
|
+
export default function (plugins: Plugins, parsers: Parsers, defaults: Record<Scopes, string[]>, includes: Particord<Scopes, string[]>, rulesets: {
|
11
11
|
[S in Scopes]: Ruleset<S>;
|
12
|
-
}): IConfig[];
|
12
|
+
}, overrides: Particord<Scopes, IRule>): IConfig[];
|
13
13
|
//# 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":"AAEA,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAClC,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACrC,QAAQ,EAAE;KAAG,CAAC,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,EACvC,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,GAClC,OAAO,EAAE,CA4FX"}
|
package/dist/index.js
CHANGED
@@ -2,29 +2,31 @@ import scopes from "./scopes.js";
|
|
2
2
|
import options from "./options.js";
|
3
3
|
export { default as Ruleset } from "./ruleset/Ruleset.js";
|
4
4
|
export { Rule } from "./ruleset/Ruleset.js";
|
5
|
-
export default function (plugins, parsers,
|
5
|
+
export default function (plugins, parsers, defaults, includes, rulesets, overrides) {
|
6
6
|
try {
|
7
|
+
for (const scope of scopes)
|
8
|
+
rulesets[scope].override(overrides[scope]);
|
7
9
|
const instantiatedOptions = {
|
8
10
|
js: new options
|
9
|
-
.js(plugins.js, ...
|
11
|
+
.js(plugins.js, ...defaults.js, ...includes.js ?? [])
|
10
12
|
.body,
|
11
13
|
ts: new options
|
12
|
-
.ts(plugins.ts, parsers.ts, ...
|
14
|
+
.ts(plugins.ts, parsers.ts, ...defaults.ts, ...includes.ts ?? [])
|
13
15
|
.body,
|
14
16
|
svelte: new options
|
15
|
-
.svelte(plugins.svelte, parsers.svelte, parsers.ts, ...
|
17
|
+
.svelte(plugins.svelte, parsers.svelte, parsers.ts, ...defaults.svelte, ...includes.svelte ?? [])
|
16
18
|
.body,
|
17
19
|
html: new options
|
18
|
-
.html(plugins.html, parsers.html, ...
|
20
|
+
.html(plugins.html, parsers.html, ...defaults.html, ...includes.html ?? [])
|
19
21
|
.body,
|
20
22
|
json: new options
|
21
|
-
.json(plugins.json, parsers.json, ...
|
23
|
+
.json(plugins.json, parsers.json, ...defaults.json, ...includes.json ?? [])
|
22
24
|
.body,
|
23
25
|
jsonc: new options
|
24
|
-
.jsonc(plugins.jsonc, parsers.jsonc, ...
|
26
|
+
.jsonc(plugins.jsonc, parsers.jsonc, ...defaults.jsonc, ...includes.jsonc ?? [])
|
25
27
|
.body,
|
26
28
|
yml: new options
|
27
|
-
.yml(plugins.yml, parsers.yml, ...
|
29
|
+
.yml(plugins.yml, parsers.yml, ...defaults.yml, ...includes.yml ?? [])
|
28
30
|
.body,
|
29
31
|
};
|
30
32
|
return scopes
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AAOnC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAG5C,MAAM,CAAC,OAAO,WACZ,OAAgB,EAChB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AI,EAAE,CACvB;iBACA,IAAI;YACP,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,IAAI,EACZ,GAAG,QAAQ,CAAC,IAAI,EAChB,GAAG,QAAQ,CAAC,IAAI,IAAI,EAAE,CACvB;iBACA,IAAI;YACP,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,KAAK,EACb,GAAG,QAAQ,CAAC,KAAK,EACjB,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,CACxB;iBACA,IAAI;YACP,GAAG,EAAE,IAAI,OAAO;iBACb,GAAG,CACF,OAAO,CAAC,GAAG,EACX,OAAO,CAAC,GAAG,EACX,GAAG,QAAQ,CAAC,GAAG,EACf,GAAG,QAAQ,CAAC,GAAG,IAAI,EAAE,CACtB;iBACA,IAAI;SACR,CAAC;QAEF,OAAO,MAAM;aACV,GAAG,CACF,KAAK,CAAC,EAAE,CACN,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YACzC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;iBACd,IAAI;iBACJ,GAAG,CACF,KAAK,CAAC,EAAE;gBACN,OAAO;oBACL,KAAK;oBACL,GAAG,mBAAmB,CAAC,KAAK,CAAC;iBAC9B,CAAC;YACJ,CAAC,CACF;YACH,CAAC,CAAC,EAAE,CACT;aACA,IAAI,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,6BAA6B,EAC7B,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
@@ -13,15 +13,15 @@ export type { default as IConfig } from "./interface/IConfig.js";
|
|
13
13
|
export default function (
|
14
14
|
plugins: Plugins,
|
15
15
|
parsers: Parsers,
|
16
|
-
|
17
|
-
|
18
|
-
| "includes"
|
19
|
-
,
|
20
|
-
Record<Scopes, string[]>
|
21
|
-
>,
|
16
|
+
defaults: Record<Scopes, string[]>,
|
17
|
+
includes: Particord<Scopes, string[]>,
|
22
18
|
rulesets: { [S in Scopes]: Ruleset<S> },
|
19
|
+
overrides: Particord<Scopes, IRule>,
|
23
20
|
): IConfig[] {
|
24
21
|
try {
|
22
|
+
for (const scope of scopes)
|
23
|
+
rulesets[scope].override(overrides[scope]);
|
24
|
+
|
25
25
|
const instantiatedOptions: {
|
26
26
|
[S in Scopes]: InstanceType<
|
27
27
|
typeof options[S]
|
@@ -30,16 +30,16 @@ export default function (
|
|
30
30
|
js: new options
|
31
31
|
.js(
|
32
32
|
plugins.js,
|
33
|
-
...
|
34
|
-
...
|
33
|
+
...defaults.js,
|
34
|
+
...includes.js ?? [],
|
35
35
|
)
|
36
36
|
.body,
|
37
37
|
ts: new options
|
38
38
|
.ts(
|
39
39
|
plugins.ts,
|
40
40
|
parsers.ts,
|
41
|
-
...
|
42
|
-
...
|
41
|
+
...defaults.ts,
|
42
|
+
...includes.ts ?? [],
|
43
43
|
)
|
44
44
|
.body,
|
45
45
|
svelte: new options
|
@@ -47,40 +47,40 @@ export default function (
|
|
47
47
|
plugins.svelte,
|
48
48
|
parsers.svelte,
|
49
49
|
parsers.ts,
|
50
|
-
...
|
51
|
-
...
|
50
|
+
...defaults.svelte,
|
51
|
+
...includes.svelte ?? [],
|
52
52
|
)
|
53
53
|
.body,
|
54
54
|
html: new options
|
55
55
|
.html(
|
56
56
|
plugins.html,
|
57
57
|
parsers.html,
|
58
|
-
...
|
59
|
-
...
|
58
|
+
...defaults.html,
|
59
|
+
...includes.html ?? [],
|
60
60
|
)
|
61
61
|
.body,
|
62
62
|
json: new options
|
63
63
|
.json(
|
64
64
|
plugins.json,
|
65
65
|
parsers.json,
|
66
|
-
...
|
67
|
-
...
|
66
|
+
...defaults.json,
|
67
|
+
...includes.json ?? [],
|
68
68
|
)
|
69
69
|
.body,
|
70
70
|
jsonc: new options
|
71
71
|
.jsonc(
|
72
72
|
plugins.jsonc,
|
73
73
|
parsers.jsonc,
|
74
|
-
...
|
75
|
-
...
|
74
|
+
...defaults.jsonc,
|
75
|
+
...includes.jsonc ?? [],
|
76
76
|
)
|
77
77
|
.body,
|
78
78
|
yml: new options
|
79
79
|
.yml(
|
80
80
|
plugins.yml,
|
81
81
|
parsers.yml,
|
82
|
-
...
|
83
|
-
...
|
82
|
+
...defaults.yml,
|
83
|
+
...includes.yml ?? [],
|
84
84
|
)
|
85
85
|
.body,
|
86
86
|
};
|