@eslinted/core 1.0.1 → 2.0.0-rc.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/boundary/boundary.d.ts +4 -0
- package/dist/boundary/boundary.d.ts.map +1 -0
- package/dist/boundary/boundary.js +2 -0
- package/dist/boundary/boundary.js.map +1 -0
- package/dist/boundary/input/files/base/base.d.ts +5 -0
- package/dist/boundary/input/files/base/base.d.ts.map +1 -0
- package/dist/boundary/input/files/base/base.js +2 -0
- package/dist/boundary/input/files/base/base.js.map +1 -0
- package/dist/boundary/input/files/base/list/list.d.ts +3 -0
- package/dist/boundary/input/files/base/list/list.d.ts.map +1 -0
- package/dist/boundary/input/files/base/list/list.js +2 -0
- package/dist/boundary/input/files/base/list/list.js.map +1 -0
- package/dist/boundary/input/files/files.d.ts +3 -6
- package/dist/boundary/input/files/files.d.ts.map +1 -1
- package/dist/boundary/input/files/includes/includes.d.ts +4 -0
- package/dist/boundary/input/files/includes/includes.d.ts.map +1 -0
- package/dist/boundary/input/files/includes/includes.js +2 -0
- package/dist/boundary/input/files/includes/includes.js.map +1 -0
- package/dist/boundary/input/files/list/list.d.ts +3 -0
- package/dist/boundary/input/files/list/list.d.ts.map +1 -0
- package/dist/boundary/input/files/list/list.js +2 -0
- package/dist/boundary/input/files/list/list.js.map +1 -0
- package/dist/boundary/input/input.d.ts +5 -20
- package/dist/boundary/input/input.d.ts.map +1 -1
- package/dist/boundary/input/overrides/overrides.d.ts +4 -4
- package/dist/boundary/input/overrides/overrides.d.ts.map +1 -1
- package/dist/boundary/input/parsers/parsers.d.ts +3 -6
- package/dist/boundary/input/parsers/parsers.d.ts.map +1 -1
- package/dist/boundary/input/plugins/plugins.d.ts +5 -6
- package/dist/boundary/input/plugins/plugins.d.ts.map +1 -1
- package/dist/boundary/input/rules/entry/entry.d.ts +3 -3
- package/dist/boundary/input/rules/entry/entry.d.ts.map +1 -1
- package/dist/boundary/input/rules/entry/object/object.d.ts +3 -3
- package/dist/boundary/input/rules/entry/object/object.d.ts.map +1 -1
- package/dist/boundary/input/rules/entry/object/state/level.d.ts +3 -0
- package/dist/boundary/input/rules/entry/object/state/level.d.ts.map +1 -0
- package/dist/boundary/input/rules/entry/object/state/level.js +2 -0
- package/dist/boundary/input/rules/entry/object/state/level.js.map +1 -0
- package/dist/boundary/input/rules/overrides/overrides.d.ts +5 -0
- package/dist/boundary/input/rules/overrides/overrides.d.ts.map +1 -0
- package/dist/boundary/input/rules/overrides/overrides.js +2 -0
- package/dist/boundary/input/rules/overrides/overrides.js.map +1 -0
- package/dist/boundary/input/rules/preset/entry/entry.d.ts +4 -0
- package/dist/boundary/input/rules/preset/entry/entry.d.ts.map +1 -0
- package/dist/boundary/input/rules/preset/entry/entry.js +2 -0
- package/dist/boundary/input/rules/preset/entry/entry.js.map +1 -0
- package/dist/boundary/input/rules/preset/entry/object/object.d.ts +4 -0
- package/dist/boundary/input/rules/preset/entry/object/object.d.ts.map +1 -0
- package/dist/boundary/input/rules/preset/entry/object/object.js +2 -0
- package/dist/boundary/input/rules/preset/entry/object/object.js.map +1 -0
- package/dist/boundary/input/rules/preset/entry/object/state/level.d.ts +3 -0
- package/dist/boundary/input/rules/preset/entry/object/state/level.d.ts.map +1 -0
- package/dist/boundary/input/rules/preset/entry/object/state/level.js +2 -0
- package/dist/boundary/input/rules/preset/entry/object/state/level.js.map +1 -0
- package/dist/boundary/input/rules/preset/preset.d.ts +5 -0
- package/dist/boundary/input/rules/preset/preset.d.ts.map +1 -0
- package/dist/boundary/input/rules/preset/preset.js +2 -0
- package/dist/boundary/input/rules/preset/preset.js.map +1 -0
- package/dist/boundary/input/rules/rules.d.ts +3 -5
- package/dist/boundary/input/rules/rules.d.ts.map +1 -1
- package/dist/boundary/output/config/config.d.ts +2 -2
- package/dist/boundary/output/config/config.d.ts.map +1 -1
- package/dist/boundary/output/output.d.ts +2 -2
- package/dist/dependency/dependency.d.ts +4 -0
- package/dist/dependency/dependency.d.ts.map +1 -0
- package/dist/dependency/dependency.js +2 -0
- package/dist/dependency/dependency.js.map +1 -0
- package/dist/dependency/parsers/index.d.ts +3 -0
- package/dist/dependency/parsers/index.d.ts.map +1 -0
- package/dist/dependency/parsers/index.js +2 -0
- package/dist/dependency/parsers/index.js.map +1 -0
- package/dist/dependency/plugins/index.d.ts +3 -0
- package/dist/dependency/plugins/index.d.ts.map +1 -0
- package/dist/dependency/plugins/index.js +2 -0
- package/dist/dependency/plugins/index.js.map +1 -0
- package/dist/factory/factory.d.ts +1 -1
- package/dist/factory/factory.js +1 -1
- package/dist/factory/files/Files.d.ts +3 -3
- package/dist/factory/files/Files.d.ts.map +1 -1
- package/dist/factory/files/Files.js.map +1 -1
- package/dist/factory/options/{options.d.ts → Options.d.ts} +1 -1
- package/dist/factory/options/{options.d.ts.map → Options.d.ts.map} +1 -1
- package/dist/factory/options/{options.js → Options.js} +1 -1
- package/dist/factory/options/{options.js.map → Options.js.map} +1 -1
- package/dist/factory/options/option/Option.d.ts +4 -3
- package/dist/factory/options/option/Option.d.ts.map +1 -1
- package/dist/factory/options/option/Option.js.map +1 -1
- package/dist/factory/ruleset/Ruleset.d.ts +3 -4
- package/dist/factory/ruleset/Ruleset.d.ts.map +1 -1
- package/dist/factory/ruleset/Ruleset.js.map +1 -1
- package/dist/factory/ruleset/rule/Rule.d.ts +3 -3
- package/dist/factory/ruleset/rule/Rule.d.ts.map +1 -1
- package/dist/factory/ruleset/rule/Rule.js.map +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -29
- package/dist/index.js.map +1 -1
- package/dist/scopes/{scopes.d.ts → Scopes.d.ts} +1 -1
- package/dist/scopes/Scopes.d.ts.map +1 -0
- package/dist/scopes/{scopes.js → Scopes.js} +1 -1
- package/dist/scopes/Scopes.js.map +1 -0
- package/package.json +7 -5
- package/src/boundary/boundary.ts +4 -0
- package/src/boundary/input/files/base/base.ts +9 -0
- package/src/boundary/input/files/base/list/list.ts +6 -0
- package/src/boundary/input/files/files.ts +6 -5
- package/src/boundary/input/files/includes/includes.ts +8 -0
- package/src/boundary/input/input.ts +8 -21
- package/src/boundary/input/parsers/parsers.ts +7 -8
- package/src/boundary/input/plugins/plugins.ts +7 -4
- package/src/boundary/input/rules/overrides/overrides.ts +9 -0
- package/src/boundary/input/rules/preset/entry/entry.ts +8 -0
- package/src/boundary/input/rules/preset/entry/object/object.ts +12 -0
- package/src/boundary/input/rules/preset/entry/object/state/level.ts +9 -0
- package/src/boundary/input/rules/preset/preset.ts +9 -0
- package/src/boundary/input/rules/rules.ts +4 -8
- package/src/boundary/output/config/config.ts +2 -2
- package/src/boundary/output/output.ts +2 -2
- package/src/dependency/dependency.ts +4 -0
- package/src/dependency/parsers/index.ts +9 -0
- package/src/dependency/plugins/index.ts +10 -0
- package/src/factory/factory.ts +1 -1
- package/src/factory/files/Files.ts +4 -4
- package/src/factory/options/option/Option.ts +4 -3
- package/src/factory/ruleset/Ruleset.ts +2 -3
- package/src/factory/ruleset/rule/Rule.ts +2 -2
- package/src/index.ts +64 -52
- package/dist/boundary/input/files/array/filearray.d.ts +0 -3
- package/dist/boundary/input/files/array/filearray.d.ts.map +0 -1
- package/dist/boundary/input/files/array/filearray.js +0 -2
- package/dist/boundary/input/files/array/filearray.js.map +0 -1
- package/dist/boundary/input/rules/entry/object/state/severity.d.ts +0 -3
- package/dist/boundary/input/rules/entry/object/state/severity.d.ts.map +0 -1
- package/dist/boundary/input/rules/entry/object/state/severity.js +0 -2
- package/dist/boundary/input/rules/entry/object/state/severity.js.map +0 -1
- package/dist/scopes/scopes.d.ts.map +0 -1
- package/dist/scopes/scopes.js.map +0 -1
- package/src/boundary/input/files/array/filearray.ts +0 -3
- package/src/boundary/input/overrides/overrides.ts +0 -6
- package/src/boundary/input/rules/entry/entry.ts +0 -5
- package/src/boundary/input/rules/entry/object/object.ts +0 -5
- package/src/boundary/input/rules/entry/object/state/severity.ts +0 -6
- /package/{types/project → src}/OmitFilesRuleset.d.ts +0 -0
- /package/src/factory/options/{options.ts → Options.ts} +0 -0
- /package/src/scopes/{scopes.ts → Scopes.ts} +0 -0
package/src/index.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import type
|
3
|
-
import type Input from "./boundary/input/input.js";
|
1
|
+
import type * as Boundary from "./boundary/boundary.js";
|
2
|
+
import scopes, { type Scope } from "./scopes/Scopes.js";
|
4
3
|
import {
|
5
4
|
Options,
|
6
5
|
Files,
|
@@ -8,71 +7,68 @@ import {
|
|
8
7
|
Rule,
|
9
8
|
} from "./factory/factory.js";
|
10
9
|
|
11
|
-
export type {
|
12
|
-
Scope,
|
13
|
-
Input,
|
14
|
-
Output,
|
15
|
-
};
|
10
|
+
export type { Boundary };
|
16
11
|
export default function (
|
17
|
-
plugins: Input.Plugins,
|
18
|
-
parsers: Input.Parsers,
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
12
|
+
plugins: Boundary.Input.Plugins,
|
13
|
+
parsers: Boundary.Input.Parsers,
|
14
|
+
files: {
|
15
|
+
base: Boundary.Input.Files.Base;
|
16
|
+
includes: Boundary.Input.Files.Includes;
|
17
|
+
},
|
18
|
+
rules: {
|
19
|
+
preset: Boundary.Input.Rules.Preset;
|
20
|
+
overrides: Boundary.Input.Rules.Overrides;
|
21
|
+
},
|
22
|
+
): Boundary.Output[] {
|
24
23
|
try {
|
25
|
-
const
|
26
|
-
base,
|
27
|
-
includes,
|
24
|
+
const f = new Files(
|
25
|
+
files.base,
|
26
|
+
files.includes,
|
28
27
|
),
|
29
28
|
rulesets = {
|
30
29
|
js: new Ruleset(
|
31
30
|
"js",
|
32
|
-
...rules.js.map(args => new Rule(...args)),
|
31
|
+
...rules.preset.js.map(args => new Rule(...args)),
|
33
32
|
),
|
34
33
|
ts: new Ruleset(
|
35
34
|
"ts",
|
36
|
-
...rules.ts.map(args => new Rule(...args)),
|
35
|
+
...rules.preset.ts.map(args => new Rule(...args)),
|
37
36
|
),
|
38
37
|
svelte: new Ruleset(
|
39
38
|
"svelte",
|
40
|
-
...rules.svelte.map(args => new Rule(...args)),
|
39
|
+
...rules.preset.svelte.map(args => new Rule(...args)),
|
41
40
|
),
|
42
41
|
html: new Ruleset(
|
43
42
|
"html",
|
44
|
-
...rules.html.map(args => new Rule(...args)),
|
43
|
+
...rules.preset.html.map(args => new Rule(...args)),
|
45
44
|
),
|
46
45
|
json: new Ruleset(
|
47
46
|
"json",
|
48
|
-
...rules.json.map(args => new Rule(...args)),
|
47
|
+
...rules.preset.json.map(args => new Rule(...args)),
|
49
48
|
),
|
50
49
|
jsonc: new Ruleset(
|
51
50
|
"jsonc",
|
52
|
-
...rules.jsonc.map(args => new Rule(...args)),
|
51
|
+
...rules.preset.jsonc.map(args => new Rule(...args)),
|
53
52
|
),
|
54
53
|
yml: new Ruleset(
|
55
54
|
"yml",
|
56
|
-
...rules.yml.map(args => new Rule(...args)),
|
55
|
+
...rules.preset.yml.map(args => new Rule(...args)),
|
57
56
|
),
|
58
57
|
},
|
59
|
-
|
60
|
-
[S in Scope]:
|
58
|
+
scopedParsers: {
|
59
|
+
[S in Scope]: ConstructorParameters<typeof Options[S]>[3];
|
61
60
|
} = {
|
62
|
-
js: [
|
63
|
-
ts: [
|
64
|
-
svelte: [
|
65
|
-
|
66
|
-
|
67
|
-
] as const,
|
68
|
-
|
69
|
-
json: [plugins.json, [parsers.json]] as const,
|
70
|
-
jsonc: [plugins.jsonc, [parsers.jsonc]] as const,
|
71
|
-
yml: [plugins.yml, [parsers.yml]] as const,
|
61
|
+
js: [] as const,
|
62
|
+
ts: [parsers.ts] as const,
|
63
|
+
svelte: [parsers.svelte, parsers.ts] as const,
|
64
|
+
html: [parsers.html] as const,
|
65
|
+
json: [parsers.jsonc] as const,
|
66
|
+
jsonc: [parsers.jsonc] as const,
|
67
|
+
yml: [parsers.yml] as const,
|
72
68
|
} as const;
|
73
69
|
|
74
70
|
for (const scope of scopes)
|
75
|
-
rulesets[scope].override(overrides[scope]);
|
71
|
+
rulesets[scope].override(rules.overrides[scope]);
|
76
72
|
|
77
73
|
const options: {
|
78
74
|
[S in Scope]: InstanceType<
|
@@ -81,51 +77,67 @@ export default function (
|
|
81
77
|
} = {
|
82
78
|
js: new Options
|
83
79
|
.js(
|
84
|
-
|
80
|
+
f.files("js"),
|
85
81
|
rulesets.js,
|
86
|
-
|
82
|
+
{
|
83
|
+
"@stylistic": plugins["@stylistic"],
|
84
|
+
},
|
85
|
+
scopedParsers.js,
|
87
86
|
)
|
88
87
|
.configs,
|
89
88
|
ts: new Options
|
90
89
|
.ts(
|
91
|
-
|
90
|
+
f.files("ts"),
|
92
91
|
rulesets.ts,
|
93
|
-
|
92
|
+
{
|
93
|
+
"@stylistic": plugins["@stylistic"],
|
94
|
+
"@typescript-eslint": plugins["@typescript-eslint"],
|
95
|
+
},
|
96
|
+
scopedParsers.ts,
|
94
97
|
)
|
95
98
|
.configs,
|
96
99
|
svelte: new Options
|
97
100
|
.svelte(
|
98
|
-
|
101
|
+
f.files("svelte"),
|
99
102
|
rulesets.svelte,
|
100
|
-
|
103
|
+
{
|
104
|
+
"@stylistic": plugins["@stylistic"],
|
105
|
+
"@typescript-eslint": plugins["@typescript-eslint"],
|
106
|
+
svelte: plugins.svelte,
|
107
|
+
},
|
108
|
+
scopedParsers.svelte,
|
101
109
|
)
|
102
110
|
.configs,
|
103
111
|
html: new Options
|
104
112
|
.html(
|
105
|
-
|
113
|
+
f.files("html"),
|
106
114
|
rulesets.html,
|
107
|
-
|
115
|
+
{ "@html-eslint": plugins["@html-eslint"] },
|
116
|
+
scopedParsers.html,
|
108
117
|
)
|
109
118
|
.configs,
|
110
119
|
json: new Options
|
111
120
|
.json(
|
112
|
-
|
121
|
+
f.files("json"),
|
113
122
|
rulesets.json,
|
114
|
-
|
123
|
+
{ jsonc: plugins.jsonc },
|
124
|
+
scopedParsers.json,
|
115
125
|
)
|
116
126
|
.configs,
|
117
127
|
jsonc: new Options
|
118
128
|
.jsonc(
|
119
|
-
|
129
|
+
f.files("jsonc"),
|
120
130
|
rulesets.jsonc,
|
121
|
-
|
131
|
+
{ jsonc: plugins.jsonc },
|
132
|
+
scopedParsers.jsonc,
|
122
133
|
)
|
123
134
|
.configs,
|
124
135
|
yml: new Options
|
125
136
|
.yml(
|
126
|
-
|
137
|
+
f.files("yml"),
|
127
138
|
rulesets.yml,
|
128
|
-
|
139
|
+
{ yml: plugins.yml },
|
140
|
+
scopedParsers.yml,
|
129
141
|
)
|
130
142
|
.configs,
|
131
143
|
};
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"filearray.d.ts","sourceRoot":"","sources":["../../../../../src/boundary/input/files/array/filearray.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,SAAS,MAAM,EAAE,CAAC;AAEnC,YAAY,EAAE,SAAS,IAAI,OAAO,EAAE,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"filearray.js","sourceRoot":"","sources":["../../../../../src/boundary/input/files/array/filearray.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"severity.d.ts","sourceRoot":"","sources":["../../../../../../../src/boundary/input/rules/entry/object/state/severity.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GACT,OAAO,GACP,MAAM,GACN,KAAK,CAAC;AAEV,YAAY,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"severity.js","sourceRoot":"","sources":["../../../../../../../src/boundary/input/rules/entry/object/state/severity.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../../src/scopes/scopes.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM,iEAQF,CAAC;AAEX,eAAe,MAAM,CAAC;AACtB,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scopes.js","sourceRoot":"","sources":["../../src/scopes/scopes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACb,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;CACG,CAAC;AAEX,eAAe,MAAM,CAAC"}
|
File without changes
|
File without changes
|
File without changes
|