@eslinted/core 3.0.3-rc.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (272) hide show
  1. package/dist/boundary/index.d.ts +4 -0
  2. package/dist/boundary/index.d.ts.map +1 -0
  3. package/dist/boundary/index.js +2 -0
  4. package/dist/boundary/index.js.map +1 -0
  5. package/dist/boundary/input/files/base/index.d.ts +4 -0
  6. package/dist/boundary/input/files/base/index.d.ts.map +1 -0
  7. package/dist/boundary/input/files/base/index.js +2 -0
  8. package/dist/boundary/input/files/base/index.js.map +1 -0
  9. package/dist/boundary/input/files/includes/index.d.ts +4 -0
  10. package/dist/boundary/input/files/includes/index.d.ts.map +1 -0
  11. package/dist/boundary/input/files/includes/index.js +2 -0
  12. package/dist/boundary/input/files/includes/index.js.map +1 -0
  13. package/dist/boundary/input/files/index.d.ts +4 -0
  14. package/dist/boundary/input/files/index.d.ts.map +1 -0
  15. package/dist/boundary/input/files/index.js +2 -0
  16. package/dist/boundary/input/files/index.js.map +1 -0
  17. package/dist/boundary/input/index.d.ts +6 -0
  18. package/dist/boundary/input/index.d.ts.map +1 -0
  19. package/dist/boundary/input/index.js +2 -0
  20. package/dist/boundary/input/index.js.map +1 -0
  21. package/dist/boundary/input/parsers/{parsers.d.ts → index.d.ts} +3 -3
  22. package/dist/boundary/input/parsers/index.d.ts.map +1 -0
  23. package/dist/boundary/input/parsers/index.js +2 -0
  24. package/dist/boundary/input/parsers/index.js.map +1 -0
  25. package/dist/boundary/input/plugins/{plugins.d.ts → index.d.ts} +3 -3
  26. package/dist/boundary/input/plugins/index.d.ts.map +1 -0
  27. package/dist/boundary/input/plugins/index.js +2 -0
  28. package/dist/boundary/input/plugins/index.js.map +1 -0
  29. package/dist/boundary/input/rules/index.d.ts +4 -0
  30. package/dist/boundary/input/rules/index.d.ts.map +1 -0
  31. package/dist/boundary/input/rules/index.js +2 -0
  32. package/dist/boundary/input/rules/index.js.map +1 -0
  33. package/dist/boundary/input/rules/overrides/index.d.ts +5 -0
  34. package/dist/boundary/input/rules/overrides/index.d.ts.map +1 -0
  35. package/dist/boundary/input/rules/overrides/index.js +2 -0
  36. package/dist/boundary/input/rules/overrides/index.js.map +1 -0
  37. package/dist/boundary/input/rules/preset/entry/index.d.ts +4 -0
  38. package/dist/boundary/input/rules/preset/entry/index.d.ts.map +1 -0
  39. package/dist/boundary/input/rules/preset/entry/index.js +2 -0
  40. package/dist/boundary/input/rules/preset/entry/index.js.map +1 -0
  41. package/dist/boundary/input/rules/preset/entry/object/index.d.ts +4 -0
  42. package/dist/boundary/input/rules/preset/entry/object/index.d.ts.map +1 -0
  43. package/dist/boundary/input/rules/preset/entry/object/index.js +2 -0
  44. package/dist/boundary/input/rules/preset/entry/object/index.js.map +1 -0
  45. package/dist/boundary/input/rules/preset/entry/object/state/index.d.ts +3 -0
  46. package/dist/boundary/input/rules/preset/entry/object/state/index.d.ts.map +1 -0
  47. package/dist/boundary/input/rules/preset/entry/object/state/index.js +2 -0
  48. package/dist/boundary/input/rules/preset/entry/object/state/index.js.map +1 -0
  49. package/dist/boundary/input/rules/preset/index.d.ts +5 -0
  50. package/dist/boundary/input/rules/preset/index.d.ts.map +1 -0
  51. package/dist/boundary/input/rules/preset/index.js +2 -0
  52. package/dist/boundary/input/rules/preset/index.js.map +1 -0
  53. package/dist/boundary/output/config/{config.d.ts → index.d.ts} +2 -2
  54. package/dist/boundary/output/config/index.d.ts.map +1 -0
  55. package/dist/boundary/output/config/index.js +2 -0
  56. package/dist/boundary/output/config/index.js.map +1 -0
  57. package/dist/boundary/output/index.d.ts +3 -0
  58. package/dist/boundary/output/index.d.ts.map +1 -0
  59. package/dist/boundary/output/index.js +2 -0
  60. package/dist/boundary/output/index.js.map +1 -0
  61. package/dist/dependency/{dependency.d.ts → index.d.ts} +2 -2
  62. package/dist/dependency/index.d.ts.map +1 -0
  63. package/dist/dependency/index.js +2 -0
  64. package/dist/dependency/index.js.map +1 -0
  65. package/dist/dependency/parsers/index.d.ts +1 -1
  66. package/dist/dependency/parsers/index.d.ts.map +1 -1
  67. package/dist/factory/files/{Files.d.ts → index.d.ts} +3 -3
  68. package/dist/factory/files/index.d.ts.map +1 -0
  69. package/dist/factory/files/{Files.js → index.js} +2 -5
  70. package/dist/factory/files/index.js.map +1 -0
  71. package/dist/factory/index.d.ts +5 -0
  72. package/dist/factory/index.d.ts.map +1 -0
  73. package/dist/factory/index.js +5 -0
  74. package/dist/factory/index.js.map +1 -0
  75. package/dist/factory/options/{Options.d.ts → index.d.ts} +1 -1
  76. package/dist/factory/options/index.d.ts.map +1 -0
  77. package/dist/factory/options/{Options.js → index.js} +1 -1
  78. package/dist/factory/options/index.js.map +1 -0
  79. package/dist/factory/options/option/html/index.d.ts +1 -1
  80. package/dist/factory/options/option/html/index.d.ts.map +1 -1
  81. package/dist/factory/options/option/html/index.js +3 -8
  82. package/dist/factory/options/option/html/index.js.map +1 -1
  83. package/dist/factory/options/option/{Option.d.ts → index.d.ts} +5 -5
  84. package/dist/factory/options/option/{Option.d.ts.map → index.d.ts.map} +1 -1
  85. package/dist/factory/options/option/{Option.js → index.js} +3 -11
  86. package/dist/factory/options/option/index.js.map +1 -0
  87. package/dist/factory/options/option/js/index.d.ts +1 -1
  88. package/dist/factory/options/option/js/index.d.ts.map +1 -1
  89. package/dist/factory/options/option/js/index.js +5 -10
  90. package/dist/factory/options/option/js/index.js.map +1 -1
  91. package/dist/factory/options/option/json/index.d.ts +1 -1
  92. package/dist/factory/options/option/json/index.d.ts.map +1 -1
  93. package/dist/factory/options/option/json/index.js +3 -8
  94. package/dist/factory/options/option/json/index.js.map +1 -1
  95. package/dist/factory/options/option/jsonc/index.d.ts +1 -1
  96. package/dist/factory/options/option/jsonc/index.d.ts.map +1 -1
  97. package/dist/factory/options/option/jsonc/index.js +3 -8
  98. package/dist/factory/options/option/jsonc/index.js.map +1 -1
  99. package/dist/factory/options/option/md/index.d.ts +1 -1
  100. package/dist/factory/options/option/md/index.d.ts.map +1 -1
  101. package/dist/factory/options/option/md/index.js +3 -8
  102. package/dist/factory/options/option/md/index.js.map +1 -1
  103. package/dist/factory/options/option/mocha/index.d.ts +2 -2
  104. package/dist/factory/options/option/mocha/index.d.ts.map +1 -1
  105. package/dist/factory/options/option/mocha/index.js +9 -18
  106. package/dist/factory/options/option/mocha/index.js.map +1 -1
  107. package/dist/factory/options/option/svelte/index.d.ts +6 -6
  108. package/dist/factory/options/option/svelte/index.d.ts.map +1 -1
  109. package/dist/factory/options/option/svelte/index.js +12 -17
  110. package/dist/factory/options/option/svelte/index.js.map +1 -1
  111. package/dist/factory/options/option/ts/index.d.ts +4 -4
  112. package/dist/factory/options/option/ts/index.d.ts.map +1 -1
  113. package/dist/factory/options/option/ts/index.js +8 -17
  114. package/dist/factory/options/option/ts/index.js.map +1 -1
  115. package/dist/factory/options/option/yml/index.d.ts +1 -1
  116. package/dist/factory/options/option/yml/index.d.ts.map +1 -1
  117. package/dist/factory/options/option/yml/index.js +3 -8
  118. package/dist/factory/options/option/yml/index.js.map +1 -1
  119. package/dist/factory/ruleset/{Ruleset.d.ts → index.d.ts} +4 -4
  120. package/dist/factory/ruleset/index.d.ts.map +1 -0
  121. package/dist/factory/ruleset/{Ruleset.js → index.js} +7 -17
  122. package/dist/factory/ruleset/index.js.map +1 -0
  123. package/dist/factory/ruleset/rule/{Rule.d.ts → index.d.ts} +2 -2
  124. package/dist/factory/ruleset/rule/index.d.ts.map +1 -0
  125. package/dist/factory/ruleset/rule/{Rule.js → index.js} +1 -1
  126. package/dist/factory/ruleset/rule/index.js.map +1 -0
  127. package/dist/index.d.ts +1 -1
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.js +13 -39
  130. package/dist/index.js.map +1 -1
  131. package/dist/scopes/{Scopes.d.ts → index.d.ts} +1 -1
  132. package/dist/scopes/index.d.ts.map +1 -0
  133. package/dist/scopes/{Scopes.js → index.js} +1 -1
  134. package/dist/scopes/index.js.map +1 -0
  135. package/package.json +1 -1
  136. package/src/boundary/index.ts +4 -0
  137. package/src/boundary/input/files/base/index.ts +5 -0
  138. package/src/boundary/input/files/includes/index.ts +5 -0
  139. package/src/boundary/input/files/index.ts +4 -0
  140. package/src/boundary/input/index.ts +6 -0
  141. package/src/boundary/input/parsers/{parsers.ts → index.ts} +2 -6
  142. package/src/boundary/input/plugins/{plugins.ts → index.ts} +2 -6
  143. package/src/boundary/input/rules/index.ts +4 -0
  144. package/src/boundary/input/rules/overrides/index.ts +6 -0
  145. package/src/boundary/input/rules/preset/entry/index.ts +5 -0
  146. package/src/boundary/input/rules/preset/entry/object/index.ts +9 -0
  147. package/src/boundary/input/rules/preset/entry/object/state/index.ts +6 -0
  148. package/src/boundary/input/rules/preset/index.ts +6 -0
  149. package/src/boundary/output/config/{config.ts → index.ts} +1 -1
  150. package/src/boundary/output/index.ts +3 -0
  151. package/src/dependency/{dependency.ts → index.ts} +1 -5
  152. package/src/dependency/parsers/index.ts +1 -1
  153. package/src/factory/files/index.ts +16 -0
  154. package/src/factory/index.ts +10 -0
  155. package/src/factory/options/option/html/index.ts +3 -11
  156. package/src/factory/options/option/{Option.ts → index.ts} +19 -49
  157. package/src/factory/options/option/js/index.ts +5 -13
  158. package/src/factory/options/option/json/index.ts +3 -11
  159. package/src/factory/options/option/jsonc/index.ts +3 -11
  160. package/src/factory/options/option/md/index.ts +3 -11
  161. package/src/factory/options/option/mocha/index.ts +11 -23
  162. package/src/factory/options/option/svelte/index.ts +13 -23
  163. package/src/factory/options/option/ts/index.ts +9 -22
  164. package/src/factory/options/option/yml/index.ts +3 -11
  165. package/src/factory/ruleset/index.ts +40 -0
  166. package/src/factory/ruleset/rule/{Rule.ts → index.ts} +1 -1
  167. package/src/index.ts +31 -98
  168. package/dist/boundary/boundary.d.ts +0 -4
  169. package/dist/boundary/boundary.d.ts.map +0 -1
  170. package/dist/boundary/boundary.js +0 -2
  171. package/dist/boundary/boundary.js.map +0 -1
  172. package/dist/boundary/input/files/base/base.d.ts +0 -5
  173. package/dist/boundary/input/files/base/base.d.ts.map +0 -1
  174. package/dist/boundary/input/files/base/base.js +0 -2
  175. package/dist/boundary/input/files/base/base.js.map +0 -1
  176. package/dist/boundary/input/files/base/list/list.d.ts +0 -3
  177. package/dist/boundary/input/files/base/list/list.d.ts.map +0 -1
  178. package/dist/boundary/input/files/base/list/list.js +0 -2
  179. package/dist/boundary/input/files/base/list/list.js.map +0 -1
  180. package/dist/boundary/input/files/files.d.ts +0 -4
  181. package/dist/boundary/input/files/files.d.ts.map +0 -1
  182. package/dist/boundary/input/files/files.js +0 -2
  183. package/dist/boundary/input/files/files.js.map +0 -1
  184. package/dist/boundary/input/files/includes/includes.d.ts +0 -4
  185. package/dist/boundary/input/files/includes/includes.d.ts.map +0 -1
  186. package/dist/boundary/input/files/includes/includes.js +0 -2
  187. package/dist/boundary/input/files/includes/includes.js.map +0 -1
  188. package/dist/boundary/input/input.d.ts +0 -6
  189. package/dist/boundary/input/input.d.ts.map +0 -1
  190. package/dist/boundary/input/input.js +0 -2
  191. package/dist/boundary/input/input.js.map +0 -1
  192. package/dist/boundary/input/parsers/parsers.d.ts.map +0 -1
  193. package/dist/boundary/input/parsers/parsers.js +0 -2
  194. package/dist/boundary/input/parsers/parsers.js.map +0 -1
  195. package/dist/boundary/input/plugins/plugins.d.ts.map +0 -1
  196. package/dist/boundary/input/plugins/plugins.js +0 -2
  197. package/dist/boundary/input/plugins/plugins.js.map +0 -1
  198. package/dist/boundary/input/rules/overrides/overrides.d.ts +0 -5
  199. package/dist/boundary/input/rules/overrides/overrides.d.ts.map +0 -1
  200. package/dist/boundary/input/rules/overrides/overrides.js +0 -2
  201. package/dist/boundary/input/rules/overrides/overrides.js.map +0 -1
  202. package/dist/boundary/input/rules/preset/entry/entry.d.ts +0 -4
  203. package/dist/boundary/input/rules/preset/entry/entry.d.ts.map +0 -1
  204. package/dist/boundary/input/rules/preset/entry/entry.js +0 -2
  205. package/dist/boundary/input/rules/preset/entry/entry.js.map +0 -1
  206. package/dist/boundary/input/rules/preset/entry/object/object.d.ts +0 -4
  207. package/dist/boundary/input/rules/preset/entry/object/object.d.ts.map +0 -1
  208. package/dist/boundary/input/rules/preset/entry/object/object.js +0 -2
  209. package/dist/boundary/input/rules/preset/entry/object/object.js.map +0 -1
  210. package/dist/boundary/input/rules/preset/entry/object/state/level.d.ts +0 -3
  211. package/dist/boundary/input/rules/preset/entry/object/state/level.d.ts.map +0 -1
  212. package/dist/boundary/input/rules/preset/entry/object/state/level.js +0 -2
  213. package/dist/boundary/input/rules/preset/entry/object/state/level.js.map +0 -1
  214. package/dist/boundary/input/rules/preset/preset.d.ts +0 -5
  215. package/dist/boundary/input/rules/preset/preset.d.ts.map +0 -1
  216. package/dist/boundary/input/rules/preset/preset.js +0 -2
  217. package/dist/boundary/input/rules/preset/preset.js.map +0 -1
  218. package/dist/boundary/input/rules/rules.d.ts +0 -4
  219. package/dist/boundary/input/rules/rules.d.ts.map +0 -1
  220. package/dist/boundary/input/rules/rules.js +0 -2
  221. package/dist/boundary/input/rules/rules.js.map +0 -1
  222. package/dist/boundary/output/config/config.d.ts.map +0 -1
  223. package/dist/boundary/output/config/config.js +0 -2
  224. package/dist/boundary/output/config/config.js.map +0 -1
  225. package/dist/boundary/output/output.d.ts +0 -3
  226. package/dist/boundary/output/output.d.ts.map +0 -1
  227. package/dist/boundary/output/output.js +0 -2
  228. package/dist/boundary/output/output.js.map +0 -1
  229. package/dist/dependency/dependency.d.ts.map +0 -1
  230. package/dist/dependency/dependency.js +0 -2
  231. package/dist/dependency/dependency.js.map +0 -1
  232. package/dist/factory/factory.d.ts +0 -5
  233. package/dist/factory/factory.d.ts.map +0 -1
  234. package/dist/factory/factory.js +0 -5
  235. package/dist/factory/factory.js.map +0 -1
  236. package/dist/factory/files/Files.d.ts.map +0 -1
  237. package/dist/factory/files/Files.js.map +0 -1
  238. package/dist/factory/options/Options.d.ts.map +0 -1
  239. package/dist/factory/options/Options.js.map +0 -1
  240. package/dist/factory/options/option/Option.js.map +0 -1
  241. package/dist/factory/ruleset/Ruleset.d.ts.map +0 -1
  242. package/dist/factory/ruleset/Ruleset.js.map +0 -1
  243. package/dist/factory/ruleset/rule/Rule.d.ts.map +0 -1
  244. package/dist/factory/ruleset/rule/Rule.js.map +0 -1
  245. package/dist/scopes/Scopes.d.ts.map +0 -1
  246. package/dist/scopes/Scopes.js.map +0 -1
  247. package/src/OmitFilesRuleset.d.ts +0 -1
  248. package/src/boundary/boundary.ts +0 -4
  249. package/src/boundary/input/files/base/base.ts +0 -9
  250. package/src/boundary/input/files/base/list/list.ts +0 -6
  251. package/src/boundary/input/files/files.ts +0 -7
  252. package/src/boundary/input/files/includes/includes.ts +0 -8
  253. package/src/boundary/input/input.ts +0 -9
  254. package/src/boundary/input/rules/overrides/overrides.ts +0 -9
  255. package/src/boundary/input/rules/preset/entry/entry.ts +0 -8
  256. package/src/boundary/input/rules/preset/entry/object/object.ts +0 -12
  257. package/src/boundary/input/rules/preset/entry/object/state/level.ts +0 -9
  258. package/src/boundary/input/rules/preset/preset.ts +0 -9
  259. package/src/boundary/input/rules/rules.ts +0 -7
  260. package/src/boundary/output/output.ts +0 -3
  261. package/src/factory/factory.ts +0 -10
  262. package/src/factory/files/Files.ts +0 -24
  263. package/src/factory/ruleset/Ruleset.ts +0 -72
  264. /package/src/boundary/output/config/option/{IOption.d.ts → index.d.ts} +0 -0
  265. /package/src/boundary/output/config/option/language/ecma/{IOLanguageEcma.d.ts → index.d.ts} +0 -0
  266. /package/src/boundary/output/config/option/language/{IOLanguage.d.ts → index.d.ts} +0 -0
  267. /package/src/boundary/output/config/option/language/source/{IOLanguageSource.d.ts → index.d.ts} +0 -0
  268. /package/src/boundary/output/config/option/linter/{IOLinter.d.ts → index.d.ts} +0 -0
  269. /package/src/boundary/output/config/option/plugins/{IOPlugins.d.ts → index.d.ts} +0 -0
  270. /package/src/boundary/output/config/option/processor/{IOProcessor.d.ts → index.d.ts} +0 -0
  271. /package/src/factory/options/{Options.ts → index.ts} +0 -0
  272. /package/src/scopes/{Scopes.ts → index.ts} +0 -0
@@ -0,0 +1,4 @@
1
+ import type Output from "./output/index.js";
2
+
3
+ export type * as Input from "./input/index.js";
4
+ export type { Output };
@@ -0,0 +1,5 @@
1
+ import type { Scope } from "../../../../scopes/index.js";
2
+
3
+ type Base = Readonly<Record<Scope, readonly string[]>>;
4
+
5
+ export type { Base, Base as default };
@@ -0,0 +1,5 @@
1
+ import type * as Includes from "../base/index.js";
2
+
3
+ type Includes = Partial<Includes.Base>;
4
+
5
+ export type { Includes, Includes as default };
@@ -0,0 +1,4 @@
1
+ import type Base from "./base/index.js";
2
+ import type Includes from "./includes/index.js";
3
+
4
+ export type { Base, Includes };
@@ -0,0 +1,6 @@
1
+ import type Plugins from "./plugins/index.js";
2
+ import type Parsers from "./parsers/index.js";
3
+
4
+ export type { Plugins, Parsers };
5
+ export type * as Files from "./files/index.js";
6
+ export type * as Rules from "./rules/index.js";
@@ -1,9 +1,5 @@
1
- import type { Parsers as Dependencies } from "../../../dependency/dependency.js";
1
+ import type { Parsers as Dependencies } from "../../../dependency/index.js";
2
2
 
3
3
  type Parsers = Readonly<Record<Dependencies, unknown>>;
4
4
 
5
- export type {
6
- Parsers as default,
7
- Parsers,
8
- Dependencies,
9
- };
5
+ export type { Dependencies, Parsers, Parsers as default };
@@ -1,9 +1,5 @@
1
- import type { Plugins as Dependencies } from "../../../dependency/dependency.js";
1
+ import type { Plugins as Dependencies } from "../../../dependency/index.js";
2
2
 
3
3
  type Plugins = Readonly<Record<Dependencies, { configs: unknown }>>;
4
4
 
5
- export type {
6
- Plugins as default,
7
- Plugins,
8
- Dependencies,
9
- };
5
+ export type { Dependencies, Plugins, Plugins as default };
@@ -0,0 +1,4 @@
1
+ import type Preset from "./preset/index.js";
2
+ import type Overrides from "./overrides/index.js";
3
+
4
+ export type { Preset, Overrides };
@@ -0,0 +1,6 @@
1
+ import type { Scope } from "../../../../scopes/index.js";
2
+ import type * as Overrides from "../preset/index.js";
3
+
4
+ type Overrides = Readonly<Partial<Record<Scope, Overrides.Preset.Entry.Object>>>;
5
+
6
+ export type { Overrides, Overrides as default };
@@ -0,0 +1,5 @@
1
+ import type * as Entry from "./object/index.js";
2
+
3
+ type Entry = readonly [string, Entry.Object];
4
+
5
+ export type { Entry, Entry as default };
@@ -0,0 +1,9 @@
1
+ import type * as Object from "./state/index.js";
2
+
3
+ type Object = Readonly<Record<
4
+ string,
5
+ | Object.Level
6
+ | readonly [Object.Level, ...unknown[]]
7
+ >>;
8
+
9
+ export type { Object, Object as default };
@@ -0,0 +1,6 @@
1
+ type Level =
2
+ | "error"
3
+ | "warn"
4
+ | "off";
5
+
6
+ export type { Level, Level as default };
@@ -0,0 +1,6 @@
1
+ import type { Scope } from "../../../../scopes/index.js";
2
+ import type * as Preset from "./entry/index.js";
3
+
4
+ type Preset = Readonly<Record<Scope, readonly Preset.Entry[]>>;
5
+
6
+ export type { Preset, Preset as default };
@@ -1,4 +1,4 @@
1
- import type { Rules } from "../../input/input.js";
1
+ import type { Rules } from "../../input/index.js";
2
2
 
3
3
  export default interface Config {
4
4
  name: `linted/scope:${string}/rule:${string}+${string}`;
@@ -0,0 +1,3 @@
1
+ import type Config from "./config/index.js";
2
+
3
+ export type { Config as default };
@@ -2,8 +2,4 @@ import type Plugins from "./plugins/index.js";
2
2
  import type Parsers from "./parsers/index.js";
3
3
  import type Globals from "./globals/index.js";
4
4
 
5
- export type {
6
- Plugins,
7
- Parsers,
8
- Globals,
9
- };
5
+ export type { Plugins, Parsers, Globals };
@@ -1,4 +1,4 @@
1
- import type { Scope } from "../../scopes/Scopes.js";
1
+ import type { Scope } from "../../scopes/index.js";
2
2
 
3
3
  type Parsers =
4
4
  | "ts"
@@ -0,0 +1,16 @@
1
+ import type { Scope } from "../../scopes/index.js";
2
+ import type { Input } from "../../boundary/index.js";
3
+
4
+ export default class Files {
5
+ constructor(
6
+ private readonly base: Input.Files.Base,
7
+ private readonly includes: Input.Files.Includes,
8
+ ) {}
9
+
10
+ public files(scope: Scope): readonly string[] {
11
+ try {
12
+ return [...this.base[scope], ...this.includes[scope] ?? []];
13
+ }
14
+ catch (e) { throw new Error(`linted.factory.Files/scope:${scope}`, { cause: e }); }
15
+ }
16
+ }
@@ -0,0 +1,10 @@
1
+ import Ruleset, { Rule } from "./ruleset/index.js";
2
+ import Files from "./files/index.js";
3
+ import Options from "./options/index.js";
4
+
5
+ export {
6
+ Options,
7
+ Files,
8
+ Ruleset,
9
+ Rule,
10
+ };
@@ -1,4 +1,4 @@
1
- import Option from "../Option.js";
1
+ import Option from "../index.js";
2
2
 
3
3
  export default class Html extends Option<
4
4
  "html",
@@ -11,16 +11,8 @@ export default class Html extends Option<
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
14
- try {
15
- const [parser] = this.parser;
14
+ const [parser] = this.parser;
16
15
 
17
- return { parser } as const;
18
- }
19
- catch (e) {
20
- throw new Error(
21
- `linted.factory.options.html: languageOptions`,
22
- { cause: e },
23
- );
24
- }
16
+ return { parser } as const;
25
17
  }
26
18
  }
@@ -1,8 +1,8 @@
1
1
  import globals from "globals";
2
- import type { Scope } from "../../../scopes/Scopes.js";
3
- import type { Ruleset } from "../../factory.js";
4
- import type { Plugins } from "../../../dependency/dependency.js";
5
- import type { Output } from "../../../boundary/boundary.js";
2
+ import type { Scope } from "../../../scopes/index.js";
3
+ import type { Ruleset } from "../../index.js";
4
+ import type { Plugins } from "../../../dependency/index.js";
5
+ import type { Output } from "../../../boundary/index.js";
6
6
 
7
7
  export default abstract class Option<
8
8
  S extends Scope,
@@ -13,10 +13,7 @@ export default abstract class Option<
13
13
  GlobalTypes extends keyof typeof globals = never,
14
14
  Processor extends object = never,
15
15
  > {
16
- private readonly linterOptions = {
17
- noInlineConfig: true,
18
- reportUnusedDisableDirectives: "error",
19
- } as const;
16
+ private readonly linterOptions = { noInlineConfig: true, reportUnusedDisableDirectives: "error" } as const;
20
17
 
21
18
  public abstract readonly scope: literalful<S>;
22
19
  public abstract readonly processor: Interface<Processor> extends never
@@ -42,35 +39,25 @@ export default abstract class Option<
42
39
  } = this;
43
40
 
44
41
  if (ruleset.id !== scope)
45
- throw new TypeError(
46
- `Option and Ruleset scope mismatch`,
47
- { cause: { option: scope, ruleset: ruleset.id } },
48
- );
42
+ throw new TypeError(`Option and Ruleset scope mismatch`, { cause: { option: scope, ruleset: ruleset.id } });
49
43
  else if (files.length < 1)
50
44
  return [];
51
45
  else {
52
46
  const baseName = `linted/scope:${scope}/rule:${ruleset.id}` as const;
53
47
 
54
- return ruleset.records.map(
55
- ([ruleId, rules]) => {
56
- const name = `${baseName}+${ruleId}` as const;
48
+ return ruleset.records.map(([ruleId, rules]) => {
49
+ const name = `${baseName}+${ruleId}` as const;
57
50
 
58
- return {
59
- name,
60
- files,
61
- rules,
62
- ...option,
63
- };
64
- },
65
- );
51
+ return {
52
+ name,
53
+ files,
54
+ rules,
55
+ ...option,
56
+ };
57
+ });
66
58
  }
67
59
  }
68
- catch (e) {
69
- throw new Error(
70
- `linted.factory.Option/scope:${this.scope}: configs`,
71
- { cause: e },
72
- );
73
- }
60
+ catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: configs`, { cause: e }); }
74
61
  }
75
62
 
76
63
  private get option() {
@@ -95,29 +82,12 @@ export default abstract class Option<
95
82
  Processor
96
83
  >;
97
84
  }
98
- catch (e) {
99
- throw new Error(
100
- `linted.factory.Option/scope:${this.scope}: option`,
101
- { cause: e },
102
- );
103
- }
85
+ catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e }); }
104
86
  }
105
87
 
106
- protected abstract get languageOptions(): IOLanguage<
107
- IsEcma,
108
- ParserOptions,
109
- GlobalTypes
110
- >;
88
+ protected abstract get languageOptions(): IOLanguage<IsEcma, ParserOptions, GlobalTypes>;
111
89
 
112
90
  protected globals(type: GlobalTypes) {
113
- try {
114
- return globals[type];
115
- }
116
- catch (e) {
117
- throw new Error(
118
- `linted.factory.Option/scope:${this.scope}: globals`,
119
- { cause: e },
120
- );
121
- }
91
+ return globals[type];
122
92
  }
123
93
  }
@@ -1,21 +1,13 @@
1
- import Option from "../Option.js";
1
+ import Option from "../index.js";
2
2
 
3
3
  export default class Js extends Option<"js", "@stylistic"> {
4
4
  public readonly scope = "js";
5
5
  public readonly processor = {};
6
6
 
7
7
  public get languageOptions() {
8
- try {
9
- return {
10
- ecmaVersion: "latest",
11
- sourceType: "module",
12
- } as const;
13
- }
14
- catch (e) {
15
- throw new Error(
16
- `linted.factory.options.js: languageOptions`,
17
- { cause: e },
18
- );
19
- }
8
+ return {
9
+ ecmaVersion: "latest",
10
+ sourceType: "module",
11
+ } as const;
20
12
  }
21
13
  }
@@ -1,4 +1,4 @@
1
- import Option from "../Option.js";
1
+ import Option from "../index.js";
2
2
 
3
3
  export default class Json extends Option<
4
4
  "json",
@@ -11,16 +11,8 @@ export default class Json extends Option<
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
14
- try {
15
- const [parser] = this.parser;
14
+ const [parser] = this.parser;
16
15
 
17
- return { parser } as const;
18
- }
19
- catch (e) {
20
- throw new Error(
21
- `linted.factory.options.json: languageOptions`,
22
- { cause: e },
23
- );
24
- }
16
+ return { parser } as const;
25
17
  }
26
18
  }
@@ -1,4 +1,4 @@
1
- import Option from "../Option.js";
1
+ import Option from "../index.js";
2
2
 
3
3
  export default class Jsonc extends Option<
4
4
  "jsonc",
@@ -11,16 +11,8 @@ export default class Jsonc extends Option<
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
14
- try {
15
- const [parser] = this.parser;
14
+ const [parser] = this.parser;
16
15
 
17
- return { parser } as const;
18
- }
19
- catch (e) {
20
- throw new Error(
21
- `linted.factory.options.jsonc: languageOptions`,
22
- { cause: e },
23
- );
24
- }
16
+ return { parser } as const;
25
17
  }
26
18
  }
@@ -1,4 +1,4 @@
1
- import Option from "../Option.js";
1
+ import Option from "../index.js";
2
2
 
3
3
  export default class Md extends Option<
4
4
  "md",
@@ -11,16 +11,8 @@ export default class Md extends Option<
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
14
- try {
15
- const [parser] = this.parser;
14
+ const [parser] = this.parser;
16
15
 
17
- return { parser } as const;
18
- }
19
- catch (e) {
20
- throw new Error(
21
- `linted.factory.options.md: languageOptions`,
22
- { cause: e },
23
- );
24
- }
16
+ return { parser } as const;
25
17
  }
26
18
  }
@@ -1,11 +1,11 @@
1
- import Option from "../Option.js";
1
+ import Option from "../index.js";
2
2
  import type Ts from "../ts/index.js";
3
3
 
4
4
  export default class Mocha extends Option<
5
5
  "mocha",
6
6
  "mocha" | keyof Ts["option"]["plugins"],
7
7
  true,
8
- & Ts["option"]["languageOptions"]["parserOptions"],
8
+ Ts["option"]["languageOptions"]["parserOptions"],
9
9
  1,
10
10
  "mocha"
11
11
  > {
@@ -14,27 +14,15 @@ export default class Mocha extends Option<
14
14
  public readonly types = ["mocha"] as const;
15
15
 
16
16
  public get languageOptions() {
17
- try {
18
- const [parser] = this.parser,
19
- globals = this.globals("mocha");
17
+ const [parser] = this.parser,
18
+ globals = this.globals("mocha");
20
19
 
21
- return {
22
- ecmaVersion: "latest",
23
- sourceType: "module",
24
- parser,
25
- parserOptions: {
26
- ecmaVersion: "latest",
27
- sourceType: "module",
28
- project: "tsconfig.json",
29
- },
30
- globals,
31
- } as const;
32
- }
33
- catch (e) {
34
- throw new Error(
35
- `linted.factory.options.mocha: languageOptions`,
36
- { cause: e },
37
- );
38
- }
20
+ return {
21
+ ecmaVersion: "latest",
22
+ sourceType: "module",
23
+ parser,
24
+ parserOptions: { project: "tsconfig.json", ecmaVersion: "latest", sourceType: "module" },
25
+ globals,
26
+ } as const;
39
27
  }
40
28
  }
@@ -1,13 +1,11 @@
1
- import Option from "../Option.js";
1
+ import Option from "../index.js";
2
2
  import type Ts from "../ts/index.js";
3
3
 
4
4
  export default class Svelte extends Option<
5
5
  "svelte",
6
6
  "svelte" | keyof Ts["option"]["plugins"],
7
7
  true,
8
- & Ts["option"]["languageOptions"]["parserOptions"]
9
- & { parser: unknown }
10
- & { extraFileExtensions: readonly [".svelte"] },
8
+ { parser: unknown } & { extraFileExtensions: readonly [".svelte"] } & Ts["option"]["languageOptions"]["parserOptions"],
11
9
  2,
12
10
  never,
13
11
  { processor: "svelte/svelte" }
@@ -16,27 +14,19 @@ export default class Svelte extends Option<
16
14
  public readonly processor = { processor: "svelte/svelte" } as const;
17
15
 
18
16
  public get languageOptions() {
19
- try {
20
- const [parser, tsParser] = this.parser;
17
+ const [parser, tsParser] = this.parser;
21
18
 
22
- return {
19
+ return {
20
+ ecmaVersion: "latest",
21
+ sourceType: "module",
22
+ parser,
23
+ parserOptions: {
24
+ parser: tsParser,
25
+ extraFileExtensions: [".svelte"] as const,
26
+ project: "tsconfig.json",
23
27
  ecmaVersion: "latest",
24
28
  sourceType: "module",
25
- parser,
26
- parserOptions: {
27
- ecmaVersion: "latest",
28
- sourceType: "module",
29
- project: "tsconfig.json",
30
- extraFileExtensions: [".svelte"] as const,
31
- parser: tsParser,
32
- },
33
- } as const;
34
- }
35
- catch (e) {
36
- throw new Error(
37
- `linted.factory.options.svelte: languageOptions`,
38
- { cause: e },
39
- );
40
- }
29
+ },
30
+ } as const;
41
31
  }
42
32
  }
@@ -1,37 +1,24 @@
1
- import Option from "../Option.js";
1
+ import Option from "../index.js";
2
2
  import type Js from "../js/index.js";
3
3
 
4
4
  export default class Ts extends Option<
5
5
  "ts",
6
6
  "@typescript-eslint" | keyof Js["option"]["plugins"],
7
7
  true,
8
- & Js["option"]["languageOptions"]
9
- & { project: "tsconfig.json" },
8
+ { project: "tsconfig.json" } & Js["option"]["languageOptions"],
10
9
  1
11
10
  > {
12
11
  public readonly scope = "ts";
13
12
  public readonly processor = {} as const;
14
13
 
15
14
  public get languageOptions() {
16
- try {
17
- const [parser] = this.parser;
15
+ const [parser] = this.parser;
18
16
 
19
- return {
20
- ecmaVersion: "latest",
21
- sourceType: "module",
22
- parser,
23
- parserOptions: {
24
- ecmaVersion: "latest",
25
- sourceType: "module",
26
- project: "tsconfig.json",
27
- },
28
- } as const;
29
- }
30
- catch (e) {
31
- throw new Error(
32
- `linted.factory.options.ts: languageOptions`,
33
- { cause: e },
34
- );
35
- }
17
+ return {
18
+ ecmaVersion: "latest",
19
+ sourceType: "module",
20
+ parser,
21
+ parserOptions: { project: "tsconfig.json", ecmaVersion: "latest", sourceType: "module" },
22
+ } as const;
36
23
  }
37
24
  }
@@ -1,4 +1,4 @@
1
- import Option from "../Option.js";
1
+ import Option from "../index.js";
2
2
 
3
3
  export default class Yml extends Option<
4
4
  "yml",
@@ -11,16 +11,8 @@ export default class Yml extends Option<
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
14
- try {
15
- const [parser] = this.parser;
14
+ const [parser] = this.parser;
16
15
 
17
- return { parser } as const;
18
- }
19
- catch (e) {
20
- throw new Error(
21
- `linted.factory.options.yml: languageOptions`,
22
- { cause: e },
23
- );
24
- }
16
+ return { parser } as const;
25
17
  }
26
18
  }
@@ -0,0 +1,40 @@
1
+ import type { Scope } from "../../scopes/index.js";
2
+ import Rule from "./rule/index.js";
3
+
4
+ export { Rule };
5
+ export default class Ruleset<S extends Scope> {
6
+ public readonly ruleset: readonly Rule[];
7
+ public overrides: Null<Rule> = null;
8
+
9
+ constructor(private readonly scope: literalful<S>, ...rules: readonly Rule[]) {
10
+ try {
11
+ this.ruleset = [...rules];
12
+ }
13
+ catch (e) { throw new Error(`linted.factory.Ruleset`, { cause: e }); }
14
+ }
15
+
16
+ public get id() {
17
+ const { scope } = this;
18
+
19
+ return scope;
20
+ }
21
+
22
+ public get records() {
23
+ try {
24
+ const { ruleset, overrides } = this;
25
+
26
+ return [
27
+ ...ruleset.map(rules => [rules.id, rules.rules] as const),
28
+ ...overrides === null ? [] : [[overrides.id, overrides.rules] as const] as const,
29
+ ];
30
+ }
31
+ catch (e) { throw new Error(`linted.factory.Ruleset: records`, { cause: e }); }
32
+ }
33
+
34
+ public override(overrides: undefined | Rule["rules"]) {
35
+ if (typeof overrides !== "undefined")
36
+ this.overrides = new Rule("override", overrides);
37
+
38
+ return this;
39
+ }
40
+ }
@@ -1,4 +1,4 @@
1
- import type { Input } from "../../../boundary/boundary.js";
1
+ import type { Input } from "../../../boundary/index.js";
2
2
 
3
3
  export default class {
4
4
  constructor(