@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.
Files changed (145) hide show
  1. package/dist/boundary/boundary.d.ts +4 -0
  2. package/dist/boundary/boundary.d.ts.map +1 -0
  3. package/dist/boundary/boundary.js +2 -0
  4. package/dist/boundary/boundary.js.map +1 -0
  5. package/dist/boundary/input/files/base/base.d.ts +5 -0
  6. package/dist/boundary/input/files/base/base.d.ts.map +1 -0
  7. package/dist/boundary/input/files/base/base.js +2 -0
  8. package/dist/boundary/input/files/base/base.js.map +1 -0
  9. package/dist/boundary/input/files/base/list/list.d.ts +3 -0
  10. package/dist/boundary/input/files/base/list/list.d.ts.map +1 -0
  11. package/dist/boundary/input/files/base/list/list.js +2 -0
  12. package/dist/boundary/input/files/base/list/list.js.map +1 -0
  13. package/dist/boundary/input/files/files.d.ts +3 -6
  14. package/dist/boundary/input/files/files.d.ts.map +1 -1
  15. package/dist/boundary/input/files/includes/includes.d.ts +4 -0
  16. package/dist/boundary/input/files/includes/includes.d.ts.map +1 -0
  17. package/dist/boundary/input/files/includes/includes.js +2 -0
  18. package/dist/boundary/input/files/includes/includes.js.map +1 -0
  19. package/dist/boundary/input/files/list/list.d.ts +3 -0
  20. package/dist/boundary/input/files/list/list.d.ts.map +1 -0
  21. package/dist/boundary/input/files/list/list.js +2 -0
  22. package/dist/boundary/input/files/list/list.js.map +1 -0
  23. package/dist/boundary/input/input.d.ts +5 -20
  24. package/dist/boundary/input/input.d.ts.map +1 -1
  25. package/dist/boundary/input/overrides/overrides.d.ts +4 -4
  26. package/dist/boundary/input/overrides/overrides.d.ts.map +1 -1
  27. package/dist/boundary/input/parsers/parsers.d.ts +3 -6
  28. package/dist/boundary/input/parsers/parsers.d.ts.map +1 -1
  29. package/dist/boundary/input/plugins/plugins.d.ts +5 -6
  30. package/dist/boundary/input/plugins/plugins.d.ts.map +1 -1
  31. package/dist/boundary/input/rules/entry/entry.d.ts +3 -3
  32. package/dist/boundary/input/rules/entry/entry.d.ts.map +1 -1
  33. package/dist/boundary/input/rules/entry/object/object.d.ts +3 -3
  34. package/dist/boundary/input/rules/entry/object/object.d.ts.map +1 -1
  35. package/dist/boundary/input/rules/entry/object/state/level.d.ts +3 -0
  36. package/dist/boundary/input/rules/entry/object/state/level.d.ts.map +1 -0
  37. package/dist/boundary/input/rules/entry/object/state/level.js +2 -0
  38. package/dist/boundary/input/rules/entry/object/state/level.js.map +1 -0
  39. package/dist/boundary/input/rules/overrides/overrides.d.ts +5 -0
  40. package/dist/boundary/input/rules/overrides/overrides.d.ts.map +1 -0
  41. package/dist/boundary/input/rules/overrides/overrides.js +2 -0
  42. package/dist/boundary/input/rules/overrides/overrides.js.map +1 -0
  43. package/dist/boundary/input/rules/preset/entry/entry.d.ts +4 -0
  44. package/dist/boundary/input/rules/preset/entry/entry.d.ts.map +1 -0
  45. package/dist/boundary/input/rules/preset/entry/entry.js +2 -0
  46. package/dist/boundary/input/rules/preset/entry/entry.js.map +1 -0
  47. package/dist/boundary/input/rules/preset/entry/object/object.d.ts +4 -0
  48. package/dist/boundary/input/rules/preset/entry/object/object.d.ts.map +1 -0
  49. package/dist/boundary/input/rules/preset/entry/object/object.js +2 -0
  50. package/dist/boundary/input/rules/preset/entry/object/object.js.map +1 -0
  51. package/dist/boundary/input/rules/preset/entry/object/state/level.d.ts +3 -0
  52. package/dist/boundary/input/rules/preset/entry/object/state/level.d.ts.map +1 -0
  53. package/dist/boundary/input/rules/preset/entry/object/state/level.js +2 -0
  54. package/dist/boundary/input/rules/preset/entry/object/state/level.js.map +1 -0
  55. package/dist/boundary/input/rules/preset/preset.d.ts +5 -0
  56. package/dist/boundary/input/rules/preset/preset.d.ts.map +1 -0
  57. package/dist/boundary/input/rules/preset/preset.js +2 -0
  58. package/dist/boundary/input/rules/preset/preset.js.map +1 -0
  59. package/dist/boundary/input/rules/rules.d.ts +3 -5
  60. package/dist/boundary/input/rules/rules.d.ts.map +1 -1
  61. package/dist/boundary/output/config/config.d.ts +2 -2
  62. package/dist/boundary/output/config/config.d.ts.map +1 -1
  63. package/dist/boundary/output/output.d.ts +2 -2
  64. package/dist/dependency/dependency.d.ts +4 -0
  65. package/dist/dependency/dependency.d.ts.map +1 -0
  66. package/dist/dependency/dependency.js +2 -0
  67. package/dist/dependency/dependency.js.map +1 -0
  68. package/dist/dependency/parsers/index.d.ts +3 -0
  69. package/dist/dependency/parsers/index.d.ts.map +1 -0
  70. package/dist/dependency/parsers/index.js +2 -0
  71. package/dist/dependency/parsers/index.js.map +1 -0
  72. package/dist/dependency/plugins/index.d.ts +3 -0
  73. package/dist/dependency/plugins/index.d.ts.map +1 -0
  74. package/dist/dependency/plugins/index.js +2 -0
  75. package/dist/dependency/plugins/index.js.map +1 -0
  76. package/dist/factory/factory.d.ts +1 -1
  77. package/dist/factory/factory.js +1 -1
  78. package/dist/factory/files/Files.d.ts +3 -3
  79. package/dist/factory/files/Files.d.ts.map +1 -1
  80. package/dist/factory/files/Files.js.map +1 -1
  81. package/dist/factory/options/{options.d.ts → Options.d.ts} +1 -1
  82. package/dist/factory/options/{options.d.ts.map → Options.d.ts.map} +1 -1
  83. package/dist/factory/options/{options.js → Options.js} +1 -1
  84. package/dist/factory/options/{options.js.map → Options.js.map} +1 -1
  85. package/dist/factory/options/option/Option.d.ts +4 -3
  86. package/dist/factory/options/option/Option.d.ts.map +1 -1
  87. package/dist/factory/options/option/Option.js.map +1 -1
  88. package/dist/factory/ruleset/Ruleset.d.ts +3 -4
  89. package/dist/factory/ruleset/Ruleset.d.ts.map +1 -1
  90. package/dist/factory/ruleset/Ruleset.js.map +1 -1
  91. package/dist/factory/ruleset/rule/Rule.d.ts +3 -3
  92. package/dist/factory/ruleset/rule/Rule.d.ts.map +1 -1
  93. package/dist/factory/ruleset/rule/Rule.js.map +1 -1
  94. package/dist/index.d.ts +9 -5
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +35 -29
  97. package/dist/index.js.map +1 -1
  98. package/dist/scopes/{scopes.d.ts → Scopes.d.ts} +1 -1
  99. package/dist/scopes/Scopes.d.ts.map +1 -0
  100. package/dist/scopes/{scopes.js → Scopes.js} +1 -1
  101. package/dist/scopes/Scopes.js.map +1 -0
  102. package/package.json +7 -5
  103. package/src/boundary/boundary.ts +4 -0
  104. package/src/boundary/input/files/base/base.ts +9 -0
  105. package/src/boundary/input/files/base/list/list.ts +6 -0
  106. package/src/boundary/input/files/files.ts +6 -5
  107. package/src/boundary/input/files/includes/includes.ts +8 -0
  108. package/src/boundary/input/input.ts +8 -21
  109. package/src/boundary/input/parsers/parsers.ts +7 -8
  110. package/src/boundary/input/plugins/plugins.ts +7 -4
  111. package/src/boundary/input/rules/overrides/overrides.ts +9 -0
  112. package/src/boundary/input/rules/preset/entry/entry.ts +8 -0
  113. package/src/boundary/input/rules/preset/entry/object/object.ts +12 -0
  114. package/src/boundary/input/rules/preset/entry/object/state/level.ts +9 -0
  115. package/src/boundary/input/rules/preset/preset.ts +9 -0
  116. package/src/boundary/input/rules/rules.ts +4 -8
  117. package/src/boundary/output/config/config.ts +2 -2
  118. package/src/boundary/output/output.ts +2 -2
  119. package/src/dependency/dependency.ts +4 -0
  120. package/src/dependency/parsers/index.ts +9 -0
  121. package/src/dependency/plugins/index.ts +10 -0
  122. package/src/factory/factory.ts +1 -1
  123. package/src/factory/files/Files.ts +4 -4
  124. package/src/factory/options/option/Option.ts +4 -3
  125. package/src/factory/ruleset/Ruleset.ts +2 -3
  126. package/src/factory/ruleset/rule/Rule.ts +2 -2
  127. package/src/index.ts +64 -52
  128. package/dist/boundary/input/files/array/filearray.d.ts +0 -3
  129. package/dist/boundary/input/files/array/filearray.d.ts.map +0 -1
  130. package/dist/boundary/input/files/array/filearray.js +0 -2
  131. package/dist/boundary/input/files/array/filearray.js.map +0 -1
  132. package/dist/boundary/input/rules/entry/object/state/severity.d.ts +0 -3
  133. package/dist/boundary/input/rules/entry/object/state/severity.d.ts.map +0 -1
  134. package/dist/boundary/input/rules/entry/object/state/severity.js +0 -2
  135. package/dist/boundary/input/rules/entry/object/state/severity.js.map +0 -1
  136. package/dist/scopes/scopes.d.ts.map +0 -1
  137. package/dist/scopes/scopes.js.map +0 -1
  138. package/src/boundary/input/files/array/filearray.ts +0 -3
  139. package/src/boundary/input/overrides/overrides.ts +0 -6
  140. package/src/boundary/input/rules/entry/entry.ts +0 -5
  141. package/src/boundary/input/rules/entry/object/object.ts +0 -5
  142. package/src/boundary/input/rules/entry/object/state/severity.ts +0 -6
  143. /package/{types/project → src}/OmitFilesRuleset.d.ts +0 -0
  144. /package/src/factory/options/{options.ts → Options.ts} +0 -0
  145. /package/src/scopes/{scopes.ts → Scopes.ts} +0 -0
package/src/index.ts CHANGED
@@ -1,6 +1,5 @@
1
- import scopes, { type Scope } from "./scopes/scopes.js";
2
- import type Output from "./boundary/output/output.js";
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
- base: Input.Files,
20
- includes: Partial<Input.Files>,
21
- rules: Input.Rules,
22
- overrides: Input.Overrides,
23
- ): Output[] {
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 files = new Files(
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
- imports: {
60
- [S in Scope]: OmitFilesRuleset<ConstructorParameters<typeof Options[S]>>;
58
+ scopedParsers: {
59
+ [S in Scope]: ConstructorParameters<typeof Options[S]>[3];
61
60
  } = {
62
- js: [plugins.js, []] as const,
63
- ts: [plugins.ts, [parsers.ts]] as const,
64
- svelte: [
65
- plugins.svelte,
66
- [parsers.svelte, parsers.ts],
67
- ] as const,
68
- html: [plugins.html, [parsers.html]] as const,
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
- files.files("js"),
80
+ f.files("js"),
85
81
  rulesets.js,
86
- ...imports.js,
82
+ {
83
+ "@stylistic": plugins["@stylistic"],
84
+ },
85
+ scopedParsers.js,
87
86
  )
88
87
  .configs,
89
88
  ts: new Options
90
89
  .ts(
91
- files.files("ts"),
90
+ f.files("ts"),
92
91
  rulesets.ts,
93
- ...imports.ts,
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
- files.files("svelte"),
101
+ f.files("svelte"),
99
102
  rulesets.svelte,
100
- ...imports.svelte,
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
- files.files("html"),
113
+ f.files("html"),
106
114
  rulesets.html,
107
- ...imports.html,
115
+ { "@html-eslint": plugins["@html-eslint"] },
116
+ scopedParsers.html,
108
117
  )
109
118
  .configs,
110
119
  json: new Options
111
120
  .json(
112
- files.files("json"),
121
+ f.files("json"),
113
122
  rulesets.json,
114
- ...imports.json,
123
+ { jsonc: plugins.jsonc },
124
+ scopedParsers.json,
115
125
  )
116
126
  .configs,
117
127
  jsonc: new Options
118
128
  .jsonc(
119
- files.files("jsonc"),
129
+ f.files("jsonc"),
120
130
  rulesets.jsonc,
121
- ...imports.jsonc,
131
+ { jsonc: plugins.jsonc },
132
+ scopedParsers.jsonc,
122
133
  )
123
134
  .configs,
124
135
  yml: new Options
125
136
  .yml(
126
- files.files("yml"),
137
+ f.files("yml"),
127
138
  rulesets.yml,
128
- ...imports.yml,
139
+ { yml: plugins.yml },
140
+ scopedParsers.yml,
129
141
  )
130
142
  .configs,
131
143
  };
@@ -1,3 +0,0 @@
1
- type FileArray = readonly string[];
2
- export type { FileArray as default };
3
- //# sourceMappingURL=filearray.d.ts.map
@@ -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,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=filearray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filearray.js","sourceRoot":"","sources":["../../../../../src/boundary/input/files/array/filearray.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- type Severity = "error" | "warn" | "off";
2
- export type { Severity as default };
3
- //# sourceMappingURL=severity.d.ts.map
@@ -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,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=severity.js.map
@@ -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"}
@@ -1,3 +0,0 @@
1
- type FileArray = readonly string[];
2
-
3
- export type { FileArray as default };
@@ -1,6 +0,0 @@
1
- import type { Scope } from "../../../scopes/scopes.js";
2
- import type Input from "../input.js";
3
-
4
- type Overrides = Particord<Scope, Input.Rules.Entry.Object>;
5
-
6
- export type { Overrides as default };
@@ -1,5 +0,0 @@
1
- import type RuleObject from "./object/object.js";
2
-
3
- type RuleEntry = readonly [string, RuleObject];
4
-
5
- export type { RuleEntry as default };
@@ -1,5 +0,0 @@
1
- import type Severity from "./state/severity.js";
2
-
3
- type RuleObject = Record<string, Severity | [Severity, ...unknown[]]>;
4
-
5
- export type { RuleObject as default };
@@ -1,6 +0,0 @@
1
- type Severity =
2
- | "error"
3
- | "warn"
4
- | "off";
5
-
6
- export type { Severity as default };
File without changes
File without changes
File without changes