@eslinted/core 11.1.0 → 11.2.0

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.
Files changed (216) hide show
  1. package/dist/factory/index.d.ts +2 -3
  2. package/dist/factory/index.d.ts.map +1 -1
  3. package/dist/factory/index.js.map +1 -1
  4. package/dist/factory/options/index.d.ts +1 -1
  5. package/dist/factory/options/index.d.ts.map +1 -1
  6. package/dist/factory/options/index.js.map +1 -1
  7. package/dist/factory/options/option/index.d.ts +3 -2
  8. package/dist/factory/options/option/index.d.ts.map +1 -1
  9. package/dist/factory/options/option/index.js +1 -0
  10. package/dist/factory/options/option/index.js.map +1 -1
  11. package/dist/factory/options/option/template/index.d.ts +0 -1
  12. package/dist/factory/options/option/template/index.d.ts.map +1 -1
  13. package/dist/factory/rulesets/index.d.ts +1 -1
  14. package/dist/factory/rulesets/index.d.ts.map +1 -1
  15. package/dist/factory/rulesets/index.js.map +1 -1
  16. package/dist/factory/rulesets/ruleset.d.ts +3 -6
  17. package/dist/factory/rulesets/ruleset.d.ts.map +1 -1
  18. package/dist/factory/rulesets/ruleset.js.map +1 -1
  19. package/dist/index.d.ts +4 -4
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +17 -14
  22. package/dist/index.js.map +1 -1
  23. package/dist/interface/index.d.ts +4 -0
  24. package/dist/interface/index.d.ts.map +1 -0
  25. package/dist/{input/rules → interface}/index.js.map +1 -1
  26. package/dist/interface/input/imports/index.d.ts +8 -0
  27. package/dist/interface/input/imports/index.d.ts.map +1 -0
  28. package/dist/interface/input/imports/index.js.map +1 -0
  29. package/dist/interface/input/imports/parsers/index.d.ts +4 -0
  30. package/dist/interface/input/imports/parsers/index.d.ts.map +1 -0
  31. package/dist/interface/input/imports/parsers/index.js.map +1 -0
  32. package/dist/interface/input/imports/parsers/parser.d.ts +3 -0
  33. package/dist/interface/input/imports/parsers/parser.d.ts.map +1 -0
  34. package/dist/interface/input/imports/parsers/parser.js +2 -0
  35. package/dist/interface/input/imports/parsers/parser.js.map +1 -0
  36. package/dist/interface/input/imports/plugins.d.ts +3 -0
  37. package/dist/interface/input/imports/plugins.d.ts.map +1 -0
  38. package/dist/interface/input/imports/plugins.js.map +1 -0
  39. package/dist/interface/input/index.d.ts +5 -0
  40. package/dist/interface/input/index.d.ts.map +1 -0
  41. package/dist/interface/input/index.js.map +1 -0
  42. package/dist/interface/input/user/files/defaults.d.ts +3 -0
  43. package/dist/interface/input/user/files/defaults.d.ts.map +1 -0
  44. package/dist/interface/input/user/files/defaults.js +2 -0
  45. package/dist/interface/input/user/files/defaults.js.map +1 -0
  46. package/dist/interface/input/user/files/includes.d.ts +3 -0
  47. package/dist/interface/input/user/files/includes.d.ts.map +1 -0
  48. package/dist/interface/input/user/files/includes.js +2 -0
  49. package/dist/interface/input/user/files/includes.js.map +1 -0
  50. package/dist/interface/input/user/files/index.d.ts +8 -0
  51. package/dist/interface/input/user/files/index.d.ts.map +1 -0
  52. package/dist/interface/input/user/files/index.js +2 -0
  53. package/dist/interface/input/user/files/index.js.map +1 -0
  54. package/dist/interface/input/user/index.d.ts +8 -0
  55. package/dist/interface/input/user/index.d.ts.map +1 -0
  56. package/dist/interface/input/user/index.js +2 -0
  57. package/dist/interface/input/user/index.js.map +1 -0
  58. package/dist/interface/input/user/rules/defaults.d.ts +3 -0
  59. package/dist/interface/input/user/rules/defaults.d.ts.map +1 -0
  60. package/dist/interface/input/user/rules/defaults.js +2 -0
  61. package/dist/interface/input/user/rules/defaults.js.map +1 -0
  62. package/dist/interface/input/user/rules/index.d.ts +8 -0
  63. package/dist/interface/input/user/rules/index.d.ts.map +1 -0
  64. package/dist/interface/input/user/rules/index.js +2 -0
  65. package/dist/interface/input/user/rules/index.js.map +1 -0
  66. package/dist/interface/input/user/rules/overrides.d.ts +4 -0
  67. package/dist/interface/input/user/rules/overrides.d.ts.map +1 -0
  68. package/dist/interface/input/user/rules/overrides.js +2 -0
  69. package/dist/interface/input/user/rules/overrides.js.map +1 -0
  70. package/dist/interface/output/global/ignores.d.ts +5 -0
  71. package/dist/interface/output/global/ignores.d.ts.map +1 -0
  72. package/dist/interface/output/global/ignores.js +2 -0
  73. package/dist/interface/output/global/ignores.js.map +1 -0
  74. package/dist/interface/output/global/index.d.ts +8 -0
  75. package/dist/interface/output/global/index.d.ts.map +1 -0
  76. package/dist/interface/output/global/index.js +2 -0
  77. package/dist/interface/output/global/index.js.map +1 -0
  78. package/dist/interface/output/global/system.d.ts +14 -0
  79. package/dist/interface/output/global/system.d.ts.map +1 -0
  80. package/dist/interface/output/global/system.js +2 -0
  81. package/dist/interface/output/global/system.js.map +1 -0
  82. package/dist/interface/output/index.d.ts +8 -0
  83. package/dist/interface/output/index.d.ts.map +1 -0
  84. package/dist/interface/output/index.js +2 -0
  85. package/dist/interface/output/index.js.map +1 -0
  86. package/dist/interface/output/scoped.d.ts +3 -0
  87. package/dist/interface/output/scoped.d.ts.map +1 -0
  88. package/dist/interface/output/scoped.js +2 -0
  89. package/dist/interface/output/scoped.js.map +1 -0
  90. package/dist/objects/config/index.d.ts +16 -0
  91. package/dist/objects/config/index.d.ts.map +1 -0
  92. package/dist/objects/config/index.js +2 -0
  93. package/dist/objects/config/index.js.map +1 -0
  94. package/dist/objects/config/property.d.ts +2 -0
  95. package/dist/objects/config/property.d.ts.map +1 -0
  96. package/dist/objects/config/property.js +2 -0
  97. package/dist/objects/config/property.js.map +1 -0
  98. package/dist/objects/index.d.ts +4 -0
  99. package/dist/objects/index.d.ts.map +1 -0
  100. package/dist/objects/index.js +2 -0
  101. package/dist/{input → objects}/index.js.map +1 -1
  102. package/dist/objects/plugins/index.d.ts +5 -0
  103. package/dist/objects/plugins/index.d.ts.map +1 -0
  104. package/dist/objects/plugins/index.js +2 -0
  105. package/dist/objects/plugins/index.js.map +1 -0
  106. package/dist/objects/plugins/plugin.d.ts +2 -0
  107. package/dist/objects/plugins/plugin.d.ts.map +1 -0
  108. package/dist/objects/plugins/plugin.js +2 -0
  109. package/dist/objects/plugins/plugin.js.map +1 -0
  110. package/dist/{input/rules/entry → objects/rule}/index.d.ts +2 -4
  111. package/dist/objects/rule/index.d.ts.map +1 -0
  112. package/dist/objects/rule/index.js +2 -0
  113. package/dist/objects/rule/index.js.map +1 -0
  114. package/dist/{input/rules/entry → objects/rule}/record/index.d.ts +1 -0
  115. package/dist/objects/rule/record/index.d.ts.map +1 -0
  116. package/dist/objects/rule/record/index.js +2 -0
  117. package/dist/objects/rule/record/index.js.map +1 -0
  118. package/dist/objects/rule/record/state.d.ts.map +1 -0
  119. package/dist/objects/rule/record/state.js.map +1 -0
  120. package/dist/{scopes.d.ts → scopes/index.d.ts} +1 -1
  121. package/dist/scopes/index.d.ts.map +1 -0
  122. package/dist/{scopes.js → scopes/index.js} +1 -1
  123. package/dist/scopes/index.js.map +1 -0
  124. package/dist/scopes/index.spec.d.ts +2 -0
  125. package/dist/scopes/index.spec.d.ts.map +1 -0
  126. package/dist/{scopes.spec.js → scopes/index.spec.js} +2 -2
  127. package/dist/scopes/index.spec.js.map +1 -0
  128. package/package.json +1 -1
  129. package/src/factory/index.ts +9 -4
  130. package/src/factory/options/index.ts +4 -1
  131. package/src/factory/options/option/index.ts +91 -87
  132. package/src/factory/options/option/template/index.ts +3 -3
  133. package/src/factory/rulesets/index.ts +5 -3
  134. package/src/factory/rulesets/ruleset.ts +7 -4
  135. package/src/index.ts +31 -16
  136. package/src/interface/index.ts +9 -0
  137. package/src/interface/input/imports/index.ts +12 -0
  138. package/src/interface/input/imports/parsers/index.ts +8 -0
  139. package/src/{input/imports/parsers.ts → interface/input/imports/parsers/parser.ts} +2 -2
  140. package/src/interface/input/imports/plugins.ts +3 -0
  141. package/src/interface/input/index.ts +11 -0
  142. package/src/interface/input/user/files/defaults.ts +6 -0
  143. package/src/interface/input/user/files/includes.ts +5 -0
  144. package/src/interface/input/user/files/index.ts +9 -0
  145. package/src/interface/input/user/index.ts +13 -0
  146. package/src/interface/input/user/rules/defaults.ts +9 -0
  147. package/src/interface/input/user/rules/index.ts +13 -0
  148. package/src/interface/input/user/rules/overrides.ts +7 -0
  149. package/src/interface/output/global/ignores.ts +11 -0
  150. package/src/interface/output/global/index.ts +12 -0
  151. package/src/interface/output/global/system.ts +48 -0
  152. package/src/interface/output/index.ts +13 -0
  153. package/src/interface/output/scoped.ts +3 -0
  154. package/src/objects/config/index.ts +16 -0
  155. package/src/objects/config/property.ts +12 -0
  156. package/src/objects/index.ts +10 -0
  157. package/src/objects/plugins/index.ts +6 -0
  158. package/src/{input/imports/plugins.ts → objects/plugins/plugin.ts} +1 -1
  159. package/src/objects/rule/index.ts +8 -0
  160. package/src/objects/rule/record/index.ts +7 -0
  161. package/src/{scopes.spec.ts → scopes/index.spec.ts} +1 -1
  162. package/dist/input/files.d.ts +0 -6
  163. package/dist/input/files.d.ts.map +0 -1
  164. package/dist/input/files.js +0 -2
  165. package/dist/input/files.js.map +0 -1
  166. package/dist/input/imports/parsers.d.ts +0 -3
  167. package/dist/input/imports/parsers.d.ts.map +0 -1
  168. package/dist/input/imports/parsers.js +0 -2
  169. package/dist/input/imports/parsers.js.map +0 -1
  170. package/dist/input/imports/plugins.d.ts +0 -2
  171. package/dist/input/imports/plugins.d.ts.map +0 -1
  172. package/dist/input/imports/plugins.js.map +0 -1
  173. package/dist/input/index.d.ts +0 -22
  174. package/dist/input/index.d.ts.map +0 -1
  175. package/dist/input/parsers.d.ts +0 -3
  176. package/dist/input/parsers.d.ts.map +0 -1
  177. package/dist/input/parsers.js +0 -2
  178. package/dist/input/parsers.js.map +0 -1
  179. package/dist/input/plugins.d.ts +0 -5
  180. package/dist/input/plugins.d.ts.map +0 -1
  181. package/dist/input/plugins.js +0 -2
  182. package/dist/input/plugins.js.map +0 -1
  183. package/dist/input/rules/entry/index.d.ts.map +0 -1
  184. package/dist/input/rules/entry/index.js.map +0 -1
  185. package/dist/input/rules/entry/record/index.d.ts.map +0 -1
  186. package/dist/input/rules/entry/record/index.js.map +0 -1
  187. package/dist/input/rules/entry/record/state.d.ts.map +0 -1
  188. package/dist/input/rules/entry/record/state.js.map +0 -1
  189. package/dist/input/rules/index.d.ts +0 -14
  190. package/dist/input/rules/index.d.ts.map +0 -1
  191. package/dist/output.d.ts +0 -30
  192. package/dist/output.d.ts.map +0 -1
  193. package/dist/output.js +0 -2
  194. package/dist/output.js.map +0 -1
  195. package/dist/scopes.d.ts.map +0 -1
  196. package/dist/scopes.js.map +0 -1
  197. package/dist/scopes.spec.d.ts +0 -2
  198. package/dist/scopes.spec.d.ts.map +0 -1
  199. package/dist/scopes.spec.js.map +0 -1
  200. package/src/input/files.ts +0 -6
  201. package/src/input/index.ts +0 -23
  202. package/src/input/parsers.ts +0 -3
  203. package/src/input/plugins.ts +0 -3
  204. package/src/input/rules/entry/index.ts +0 -7
  205. package/src/input/rules/entry/record/index.ts +0 -3
  206. package/src/input/rules/index.ts +0 -14
  207. package/src/output.ts +0 -68
  208. /package/dist/{input → interface}/index.js +0 -0
  209. /package/dist/{input/rules/entry → interface/input/imports}/index.js +0 -0
  210. /package/dist/{input/rules/entry/record → interface/input/imports/parsers}/index.js +0 -0
  211. /package/dist/{input → interface/input}/imports/plugins.js +0 -0
  212. /package/dist/{input/rules → interface/input}/index.js +0 -0
  213. /package/dist/{input/rules/entry → objects/rule}/record/state.d.ts +0 -0
  214. /package/dist/{input/rules/entry → objects/rule}/record/state.js +0 -0
  215. /package/src/{input/rules/entry → objects/rule}/record/state.ts +0 -0
  216. /package/src/{scopes.ts → scopes/index.ts} +0 -0
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=scoped.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoped.js","sourceRoot":"","sources":["../../../src/interface/output/scoped.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import type { RuleRecord } from "../index.js";
2
+ export interface Config {
3
+ name: `linted/${string}`;
4
+ rules: RuleRecord;
5
+ files: string[];
6
+ ignores: string[];
7
+ languageOptions: {
8
+ parser?: unknown;
9
+ parserOptions?: Table;
10
+ globals?: Table<true>;
11
+ };
12
+ processor?: string;
13
+ language?: string;
14
+ }
15
+ export type { ConfigProperty } from "./property.js";
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/objects/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAErC,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,UAAU,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,EAAE;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,aAAa,CAAC,EAAE,KAAK,CAAC;QACtB,OAAO,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;KACvB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/objects/config/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type ConfigProperty = ("name" | "plugins" | "files" | "ignores" | "rules" | "linterOptions" | "languageOptions" | "processor" | "language" | "settings");
2
+ //# sourceMappingURL=property.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../src/objects/config/property.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CACzB,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,OAAO,GACP,eAAe,GACf,iBAAiB,GACjB,WAAW,GACX,UAAU,GACV,UAAU,CACb,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=property.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property.js","sourceRoot":"","sources":["../../../src/objects/config/property.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export type { Plugins } from "./plugins/index.js";
2
+ export type { RuleEntry, RuleRecord, RuleState, } from "./rule/index.js";
3
+ export type { Config, ConfigProperty, } from "./config/index.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/objects/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,YAAY,EACV,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,MAAM,EACN,cAAc,GACf,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/input/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/objects/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { Plugin } from "./plugin.js";
2
+ export type Plugins = Record<Plugin, {
3
+ configs: unknown;
4
+ }>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/objects/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,OAAO,GAAG,MAAM,CAC1B,MAAM,EACN;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/objects/plugins/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type Plugin = ("@stylistic" | "@typescript-eslint" | "svelte" | "mocha" | "@html-eslint" | "jsonc" | "yml");
2
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/objects/plugins/plugin.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,CACjB,YAAY,GACZ,oBAAoB,GACpB,QAAQ,GACR,OAAO,GACP,cAAc,GACd,OAAO,GACP,KAAK,CACR,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/objects/plugins/plugin.ts"],"names":[],"mappings":""}
@@ -1,10 +1,8 @@
1
1
  import type { RuleRecord } from "./record/index.js";
2
+ export type { RuleRecord };
2
3
  export type RuleEntry = readonly [
3
4
  string,
4
5
  RuleRecord
5
6
  ];
6
- export declare namespace RuleEntry {
7
- type Id = string;
8
- type Record = RuleRecord;
9
- }
7
+ export type { RuleState } from "./record/index.js";
10
8
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/objects/rule/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,YAAY,EAAE,UAAU,EAAE,CAAC;AAC3B,MAAM,MAAM,SAAS,GAAG,SAAS;IAC/B,MAAM;IACN,UAAU;CACX,CAAC;AACF,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/objects/rule/index.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  import type { RuleState } from "./state.js";
2
+ export type { RuleState };
2
3
  export type RuleRecord = Table<RuleState | readonly [
3
4
  RuleState,
4
5
  ...unknown[]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/objects/rule/record/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,MAAM,MAAM,UAAU,GAAG,KAAK,CAC1B,SAAS,GACT,SAAS,CAAC,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC,CACrC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/objects/rule/record/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/objects/rule/record/state.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,CACpB,OAAO,GACP,MAAM,GACN,KAAK,CACR,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/objects/rule/record/state.ts"],"names":[],"mappings":""}
@@ -1,3 +1,3 @@
1
1
  export type Scope = typeof scopes[number];
2
2
  export declare const scopes: readonly ["js", "ts", "svelte", "mocha", "html", "json", "jsonc", "yml"];
3
- //# sourceMappingURL=scopes.d.ts.map
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AAC1C,eAAO,MAAM,MAAM,0EAST,CAAC"}
@@ -8,4 +8,4 @@ export const scopes = [
8
8
  "jsonc",
9
9
  "yml",
10
10
  ];
11
- //# sourceMappingURL=scopes.js.map
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;CACG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../src/scopes/index.spec.ts"],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { expect } from "chai";
2
- import { scopes } from "./scopes.js";
2
+ import { scopes } from "./index.js";
3
3
  describe("Scopes", function () {
4
4
  describe("shape", function () {
5
5
  it("is a non-empty array", function () {
@@ -34,4 +34,4 @@ describe("Scopes", function () {
34
34
  });
35
35
  });
36
36
  });
37
- //# sourceMappingURL=scopes.spec.js.map
37
+ //# sourceMappingURL=index.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../src/scopes/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAE3B,QAAQ,CAAC,QAAQ,EAAE;IACjB,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,sBAAsB,EAAE;YACzB,MAAM,CAAC,MAAM,CAAC;iBACX,EAAE,CAAC,OAAO,CAAC;iBACX,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,cAAc,EAAE;YACjB,MAAM,CAAC,MAAM,CAAC;iBACX,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;YACvC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;iBAC5B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,SAAS,EAAE;YACZ,MAAM,CAAC,MAAM,CAAC;iBACX,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YAClC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBACzB,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,YAAY,EAAE;YACf,MAAM,CAAC,MAAM,CAAC;iBACX,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;YACrC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;iBAC5B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,aAAa,EAAE;YAChB,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;iBAC7B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_schemaVersion": "22.11.0",
3
3
  "name": "@eslinted/core",
4
- "version": "11.1.0",
4
+ "version": "11.2.0",
5
5
  "description": "Core ESLint flat config factory npm package `linted`.",
6
6
  "keywords": [],
7
7
  "repository": "github:jimmy-zhening-luo/linted-core",
@@ -1,6 +1,11 @@
1
- export type { Scope, Input, Output } from "..";
1
+ export type {
2
+ Scope,
3
+ Input,
4
+ Config,
5
+ RuleEntry,
6
+ RuleRecord,
7
+ } from "..";
2
8
 
3
- import type { Input } from "..";
4
9
  import { Files } from "./files";
5
10
  import { Rulesets } from "./rulesets";
6
11
  import Options from "./options";
@@ -11,8 +16,8 @@ export class Factory {
11
16
  public readonly rulesets: Rulesets;
12
17
 
13
18
  constructor(
14
- files: Input["files"],
15
- rules: Input["rules"],
19
+ files: ConstructorParameters<typeof Files>[0],
20
+ rules: ConstructorParameters<typeof Rulesets>[0],
16
21
  ) {
17
22
  this.files = new Files(files);
18
23
  this.rulesets = new Rulesets(rules);
@@ -1,4 +1,7 @@
1
- export type { Scope, Input, Output } from "..";
1
+ export type {
2
+ Scope,
3
+ Config,
4
+ } from "..";
2
5
 
3
6
  import js from "./js";
4
7
  import ts from "./ts";
@@ -1,87 +1,91 @@
1
- import globals from "globals";
2
- import type { Ruleset } from "../../rulesets/ruleset";
3
- import type {
4
- Scope,
5
- Output,
6
- OptionTemplate,
7
- LanguageOptions,
8
- Globals,
9
- } from "./template";
10
-
11
- export default abstract class Option<
12
- S extends Scope,
13
- ParserOptions extends object | boolean = false,
14
- ParserCount extends 0 | 1 | 2 = 0,
15
- Global extends Globals = never,
16
- Processor extends object = never,
17
- Language extends object = never,
18
- > {
19
- public abstract readonly scope: literalful<S>;
20
- public abstract readonly processor: Interface<Processor> extends never
21
- ? object
22
- : Interface<Processor> extends Readonly<Record<"processor", string>>
23
- ? Interface<Processor>
24
- : object;
25
- public abstract readonly language: Interface<Language> extends never
26
- ? object
27
- : Interface<Language> extends Readonly<Record<"language", string>>
28
- ? Interface<Language>
29
- : object;
30
-
31
- constructor(
32
- public readonly parser: Tuple<ParserCount, unknown>,
33
- public readonly files: string[],
34
- public readonly ruleset: Ruleset,
35
- ) {}
36
-
37
- public get configs(): Output[1][] {
38
- const {
39
- scope,
40
- ruleset,
41
- files,
42
- option,
43
- } = this;
44
-
45
- if (ruleset.scope !== scope)
46
- throw new TypeError(`Scope mismatch between option and ruleset`, { cause: { option: scope, ruleset: ruleset.scope } });
47
-
48
- return files.length < 1
49
- ? []
50
- : ruleset.ruleset.map(({ id, rule }) => {
51
- return {
52
- name: `linted/${id}`,
53
- files,
54
- rules: rule,
55
- ...option,
56
- };
57
- });
58
- }
59
-
60
- private get option() {
61
- try {
62
- const {
63
- languageOptions,
64
- processor,
65
- language,
66
- } = this;
67
-
68
- return {
69
- languageOptions,
70
- ...processor,
71
- ...language,
72
- } satisfies OptionTemplate<
73
- ParserOptions,
74
- Global,
75
- Processor,
76
- Language
77
- >;
78
- }
79
- catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e }); }
80
- }
81
-
82
- protected abstract get languageOptions(): LanguageOptions<ParserOptions, Global>;
83
-
84
- protected globals(type: Global) {
85
- return globals[type];
86
- }
87
- }
1
+ import globals from "globals";
2
+ import type {
3
+ Scope,
4
+ Config,
5
+ } from "..";
6
+ import type {
7
+ OptionTemplate,
8
+ LanguageOptions,
9
+ Globals,
10
+ } from "./template";
11
+
12
+ export default abstract class Option<
13
+ S extends Scope,
14
+ ParserOptions extends
15
+ | object
16
+ | boolean = false,
17
+ ParserCount extends 0 | 1 | 2 = 0,
18
+ Global extends Globals = never,
19
+ Processor extends object = never,
20
+ Language extends object = never,
21
+ > {
22
+ public abstract readonly scope: literalful<S>;
23
+ public abstract readonly processor: Interface<Processor> extends never
24
+ ? object
25
+ : Interface<Processor> extends Readonly<Record<"processor", string>>
26
+ ? Interface<Processor>
27
+ : object;
28
+ public abstract readonly language: Interface<Language> extends never
29
+ ? object
30
+ : Interface<Language> extends Readonly<Record<"language", string>>
31
+ ? Interface<Language>
32
+ : object;
33
+
34
+ constructor(
35
+ public readonly parser: Tuple<ParserCount, unknown>,
36
+ public readonly files: string[],
37
+ public readonly ruleset: Ruleset,
38
+ ) {}
39
+
40
+ public get configs(): Config[] {
41
+ const {
42
+ scope,
43
+ ruleset,
44
+ files,
45
+ option,
46
+ } = this;
47
+
48
+ if (ruleset.scope !== scope)
49
+ throw new TypeError(`Scope mismatch between option and ruleset`, { cause: { option: scope, ruleset: ruleset.scope } });
50
+
51
+ return files.length < 1
52
+ ? []
53
+ : ruleset.ruleset.map(({ id, rule }) => {
54
+ return {
55
+ name: `linted/${id}`,
56
+ files,
57
+ ignores: [],
58
+ rules: rule,
59
+ ...option,
60
+ };
61
+ });
62
+ }
63
+
64
+ private get option() {
65
+ try {
66
+ const {
67
+ languageOptions,
68
+ processor,
69
+ language,
70
+ } = this;
71
+
72
+ return {
73
+ languageOptions,
74
+ ...processor,
75
+ ...language,
76
+ } satisfies OptionTemplate<
77
+ ParserOptions,
78
+ Global,
79
+ Processor,
80
+ Language
81
+ >;
82
+ }
83
+ catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e }); }
84
+ }
85
+
86
+ protected abstract get languageOptions(): LanguageOptions<ParserOptions, Global>;
87
+
88
+ protected globals(type: Global) {
89
+ return globals[type];
90
+ }
91
+ }
@@ -1,5 +1,3 @@
1
- export type { Scope, Input, Output } from "../..";
2
-
3
1
  import type { LanguageOptions } from "./languageOptions";
4
2
  import type { Globals } from "./globals";
5
3
 
@@ -8,7 +6,9 @@ export type {
8
6
  Globals,
9
7
  };
10
8
  export type OptionTemplate<
11
- ParserOptions extends boolean | object,
9
+ ParserOptions extends
10
+ | boolean
11
+ | object,
12
12
  GlobalTypes extends Globals,
13
13
  Processor extends object,
14
14
  Language extends object,
@@ -1,7 +1,9 @@
1
- import type { Input } from "..";
2
-
3
- export type { Input };
1
+ export type {
2
+ RuleEntry,
3
+ RuleRecord,
4
+ } from "..";
4
5
 
6
+ import type { Input } from "..";
5
7
  import { Ruleset } from "./ruleset";
6
8
 
7
9
  export class Rulesets {
@@ -1,12 +1,15 @@
1
- import type { Input } from ".";
1
+ import type {
2
+ RuleEntry,
3
+ RuleRecord,
4
+ } from ".";
2
5
 
3
6
  export class Ruleset {
4
- public readonly ruleset: { id: string; rule: Input.Rule.Entry.Record }[];
7
+ public readonly ruleset: { id: string; rule: RuleRecord }[];
5
8
 
6
9
  constructor(
7
10
  public readonly scope: string,
8
- rules: (readonly [string, Input.Rule.Entry.Record])[],
9
- override?: Input.Rule.Entry.Record,
11
+ rules: RuleEntry[],
12
+ override?: RuleRecord,
10
13
  ) {
11
14
  const map = ([id, rule]: typeof rules[number]) => {
12
15
  return {
package/src/index.ts CHANGED
@@ -1,9 +1,22 @@
1
1
  export type { Scope } from "./scopes";
2
+ export type {
3
+ Plugins,
4
+ RuleEntry,
5
+ RuleRecord,
6
+ RuleState,
7
+ Config,
8
+ ConfigProperty,
9
+ } from "./objects";
2
10
 
3
- import type { Input } from "./input";
4
- import type { Output } from "./output";
11
+ import type {
12
+ Input,
13
+ Output,
14
+ } from "./interface";
5
15
 
6
- export type { Input, Output };
16
+ export type {
17
+ Input,
18
+ Output,
19
+ };
7
20
 
8
21
  import { scopes } from "./scopes";
9
22
  import {
@@ -19,18 +32,6 @@ export default function (input: Input): Output {
19
32
  files,
20
33
  rules,
21
34
  } = input,
22
- base = {
23
- name: "linted",
24
- plugins,
25
- linterOptions: {
26
- noInlineConfig: true,
27
- reportUnusedDisableDirectives: "error",
28
- },
29
- languageOptions: {
30
- sourceType: "module",
31
- ecmaVersion: 2023,
32
- },
33
- } as const,
34
35
  factory = new Factory(files, rules),
35
36
  options: { [S in typeof scopes[number]]: InstanceType<typeof Options[S]>["configs"] } = {
36
37
  js: new Options
@@ -76,7 +77,21 @@ export default function (input: Input): Output {
76
77
  };
77
78
 
78
79
  return [
79
- base,
80
+ {
81
+ ignores: [],
82
+ } as const,
83
+ {
84
+ name: "linted",
85
+ plugins,
86
+ linterOptions: {
87
+ noInlineConfig: true,
88
+ reportUnusedDisableDirectives: "error",
89
+ },
90
+ languageOptions: {
91
+ sourceType: "module",
92
+ ecmaVersion: 2023,
93
+ },
94
+ } as const,
80
95
  ...scopes.flatMap(scope => options[scope]),
81
96
  ];
82
97
  }
@@ -0,0 +1,9 @@
1
+ export type {
2
+ Scope,
3
+ Plugins,
4
+ RuleEntry,
5
+ RuleRecord,
6
+ Config,
7
+ ConfigProperty,
8
+ } from "..";
9
+ export type { Output } from "./output";
@@ -0,0 +1,12 @@
1
+ export type {
2
+ Scope,
3
+ Plugins,
4
+ } from "..";
5
+
6
+ import type { InputPlugins } from "./plugins";
7
+ import type { InputParsers } from "./parsers";
8
+
9
+ export interface Imports {
10
+ plugins: InputPlugins;
11
+ parsers: InputParsers;
12
+ }
@@ -0,0 +1,8 @@
1
+ export type { Scope } from "..";
2
+
3
+ import type { Parser } from "./parser";
4
+
5
+ export type InputParsers = Record<
6
+ Parser,
7
+ unknown
8
+ >;
@@ -1,6 +1,6 @@
1
- import type { Scope } from "..";
1
+ import type { Scope } from ".";
2
2
 
3
- export type Parsers = Scope
3
+ export type Parser = Scope
4
4
  & (
5
5
  | "ts"
6
6
  | "svelte"
@@ -0,0 +1,3 @@
1
+ import type { Plugins } from ".";
2
+
3
+ export type InputPlugins = Plugins;
@@ -0,0 +1,11 @@
1
+ export type {
2
+ Scope,
3
+ Plugins,
4
+ RuleEntry,
5
+ RuleRecord,
6
+ } from "..";
7
+
8
+ import type { Imports } from "./imports";
9
+ import type { User } from "./user";
10
+
11
+ export type Input = Imports & User;
@@ -0,0 +1,6 @@
1
+ import type { Scope } from ".";
2
+
3
+ export type FilesDefaults = Record<
4
+ Scope,
5
+ string[]
6
+ >;
@@ -0,0 +1,5 @@
1
+ import type { FilesDefaults } from "./defaults";
2
+
3
+ export type FilesIncludes = Partial<
4
+ FilesDefaults
5
+ >;