@eslinted/core 13.0.0-rc.1 → 13.1.0-rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. package/dist/factory/factory.d.ts +175 -0
  2. package/dist/factory/factory.d.ts.map +1 -0
  3. package/dist/factory/factory.js +42 -0
  4. package/dist/factory/factory.js.map +1 -0
  5. package/dist/factory/index.d.ts +2 -3
  6. package/dist/factory/index.d.ts.map +1 -1
  7. package/dist/factory/index.js +2 -3
  8. package/dist/factory/index.js.map +1 -1
  9. package/dist/factory/ruleset.d.ts +3 -3
  10. package/dist/factory/ruleset.d.ts.map +1 -1
  11. package/dist/factory/ruleset.js +3 -3
  12. package/dist/factory/ruleset.js.map +1 -1
  13. package/dist/factory/{options → settings}/index.d.ts +1 -2
  14. package/dist/factory/settings/index.d.ts.map +1 -0
  15. package/dist/factory/settings/index.js.map +1 -0
  16. package/dist/factory/{options → settings}/scopes/html.d.ts +2 -2
  17. package/dist/factory/settings/scopes/html.d.ts.map +1 -0
  18. package/dist/factory/{options → settings}/scopes/html.js +2 -2
  19. package/dist/factory/settings/scopes/html.js.map +1 -0
  20. package/dist/factory/{options → settings}/scopes/js.d.ts +2 -2
  21. package/dist/factory/settings/scopes/js.d.ts.map +1 -0
  22. package/dist/factory/{options → settings}/scopes/js.js +2 -2
  23. package/dist/factory/settings/scopes/js.js.map +1 -0
  24. package/dist/factory/{options → settings}/scopes/json.d.ts +2 -2
  25. package/dist/factory/settings/scopes/json.d.ts.map +1 -0
  26. package/dist/factory/{options → settings}/scopes/json.js +2 -2
  27. package/dist/factory/settings/scopes/json.js.map +1 -0
  28. package/dist/factory/{options → settings}/scopes/jsonc.d.ts +2 -2
  29. package/dist/factory/settings/scopes/jsonc.d.ts.map +1 -0
  30. package/dist/factory/{options → settings}/scopes/jsonc.js +2 -2
  31. package/dist/factory/settings/scopes/jsonc.js.map +1 -0
  32. package/dist/factory/{options → settings}/scopes/mocha.d.ts +3 -3
  33. package/dist/factory/settings/scopes/mocha.d.ts.map +1 -0
  34. package/dist/factory/{options → settings}/scopes/mocha.js +5 -4
  35. package/dist/factory/settings/scopes/mocha.js.map +1 -0
  36. package/dist/factory/{options → settings}/scopes/svelte.d.ts +7 -7
  37. package/dist/factory/settings/scopes/svelte.d.ts.map +1 -0
  38. package/dist/factory/{options → settings}/scopes/svelte.js +2 -2
  39. package/dist/factory/settings/scopes/svelte.js.map +1 -0
  40. package/dist/factory/{options → settings}/scopes/ts.d.ts +5 -5
  41. package/dist/factory/settings/scopes/ts.d.ts.map +1 -0
  42. package/dist/factory/{options → settings}/scopes/ts.js +2 -2
  43. package/dist/factory/settings/scopes/ts.js.map +1 -0
  44. package/dist/factory/{options → settings}/scopes/yml.d.ts +2 -2
  45. package/dist/factory/settings/scopes/yml.d.ts.map +1 -0
  46. package/dist/factory/{options → settings}/scopes/yml.js +2 -2
  47. package/dist/factory/settings/scopes/yml.js.map +1 -0
  48. package/dist/factory/settings/setting.d.ts +48 -0
  49. package/dist/factory/settings/setting.d.ts.map +1 -0
  50. package/dist/factory/settings/setting.js +20 -0
  51. package/dist/factory/settings/setting.js.map +1 -0
  52. package/dist/index.d.ts +1 -2
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +15 -21
  55. package/dist/index.js.map +1 -1
  56. package/dist/interface/config/index.d.ts +23 -0
  57. package/dist/interface/config/index.d.ts.map +1 -0
  58. package/dist/{config → interface/config}/index.js.map +1 -1
  59. package/dist/interface/config/rule.d.ts +7 -0
  60. package/dist/interface/config/rule.d.ts.map +1 -0
  61. package/dist/{config → interface/config}/rule.js.map +1 -1
  62. package/dist/interface/configs/globals/ignores.d.ts +6 -0
  63. package/dist/interface/configs/globals/ignores.d.ts.map +1 -0
  64. package/dist/interface/configs/globals/ignores.js +2 -0
  65. package/dist/interface/configs/globals/ignores.js.map +1 -0
  66. package/dist/interface/configs/globals/index.d.ts +5 -0
  67. package/dist/interface/configs/globals/index.d.ts.map +1 -0
  68. package/dist/interface/configs/globals/index.js +2 -0
  69. package/dist/interface/configs/globals/index.js.map +1 -0
  70. package/dist/interface/configs/globals/only/index.d.ts +2 -0
  71. package/dist/interface/configs/globals/only/index.d.ts.map +1 -0
  72. package/dist/interface/configs/globals/only/index.js +2 -0
  73. package/dist/interface/configs/globals/only/index.js.map +1 -0
  74. package/dist/interface/configs/globals/plugins.d.ts +6 -0
  75. package/dist/interface/configs/globals/plugins.d.ts.map +1 -0
  76. package/dist/interface/configs/globals/plugins.js +2 -0
  77. package/dist/interface/configs/globals/plugins.js.map +1 -0
  78. package/dist/interface/configs/globals/settings.d.ts +7 -0
  79. package/dist/interface/configs/globals/settings.d.ts.map +1 -0
  80. package/dist/interface/configs/globals/settings.js +2 -0
  81. package/dist/interface/configs/globals/settings.js.map +1 -0
  82. package/dist/interface/configs/index.d.ts +3 -0
  83. package/dist/interface/configs/index.d.ts.map +1 -0
  84. package/dist/interface/configs/index.js +2 -0
  85. package/dist/interface/configs/index.js.map +1 -0
  86. package/dist/interface/configs/scoped.d.ts +7 -0
  87. package/dist/interface/configs/scoped.d.ts.map +1 -0
  88. package/dist/interface/configs/scoped.js +2 -0
  89. package/dist/interface/configs/scoped.js.map +1 -0
  90. package/dist/interface/imports/index.d.ts +3 -3
  91. package/dist/interface/imports/index.d.ts.map +1 -1
  92. package/dist/interface/imports/parsers.d.ts +2 -0
  93. package/dist/interface/imports/parsers.d.ts.map +1 -0
  94. package/dist/interface/imports/parsers.js +2 -0
  95. package/dist/interface/imports/parsers.js.map +1 -0
  96. package/dist/interface/imports/plugins.d.ts +2 -0
  97. package/dist/interface/imports/plugins.d.ts.map +1 -0
  98. package/dist/interface/imports/plugins.js +2 -0
  99. package/dist/interface/imports/plugins.js.map +1 -0
  100. package/dist/interface/index.d.ts +2 -1
  101. package/dist/interface/index.d.ts.map +1 -1
  102. package/dist/interface/input.d.ts +13 -13
  103. package/dist/interface/input.d.ts.map +1 -1
  104. package/dist/interface/output.d.ts +7 -15
  105. package/dist/interface/output.d.ts.map +1 -1
  106. package/package.json +1 -1
  107. package/src/factory/factory.ts +89 -0
  108. package/src/factory/index.ts +2 -3
  109. package/src/factory/ruleset.ts +9 -13
  110. package/src/factory/{options → settings}/index.ts +1 -2
  111. package/src/factory/settings/scopes/html.ts +16 -0
  112. package/src/factory/settings/scopes/js.ts +11 -0
  113. package/src/factory/settings/scopes/json.ts +16 -0
  114. package/src/factory/settings/scopes/jsonc.ts +16 -0
  115. package/src/factory/settings/scopes/mocha.ts +29 -0
  116. package/src/factory/{options → settings}/scopes/svelte.ts +9 -9
  117. package/src/factory/settings/scopes/ts.ts +28 -0
  118. package/src/factory/settings/scopes/yml.ts +17 -0
  119. package/src/factory/settings/setting.ts +63 -0
  120. package/src/index.ts +26 -75
  121. package/src/interface/config/index.ts +42 -0
  122. package/src/interface/config/rule.ts +14 -0
  123. package/src/interface/configs/globals/ignores.ts +10 -0
  124. package/src/interface/configs/globals/index.ts +4 -0
  125. package/src/interface/configs/globals/only/index.ts +4 -0
  126. package/src/interface/configs/globals/plugins.ts +10 -0
  127. package/src/interface/configs/globals/settings.ts +13 -0
  128. package/src/interface/configs/index.ts +2 -0
  129. package/src/interface/configs/scoped.ts +7 -0
  130. package/src/interface/imports/index.ts +2 -16
  131. package/src/interface/imports/parsers.ts +7 -0
  132. package/src/interface/imports/plugins.ts +9 -0
  133. package/src/interface/index.ts +2 -1
  134. package/src/interface/input.ts +15 -19
  135. package/src/interface/output.ts +7 -22
  136. package/dist/config/index.d.ts +0 -23
  137. package/dist/config/index.d.ts.map +0 -1
  138. package/dist/config/rule.d.ts +0 -7
  139. package/dist/config/rule.d.ts.map +0 -1
  140. package/dist/factory/global.d.ts +0 -29
  141. package/dist/factory/global.d.ts.map +0 -1
  142. package/dist/factory/global.js +0 -41
  143. package/dist/factory/global.js.map +0 -1
  144. package/dist/factory/options/index.d.ts.map +0 -1
  145. package/dist/factory/options/index.js.map +0 -1
  146. package/dist/factory/options/option.d.ts +0 -3002
  147. package/dist/factory/options/option.d.ts.map +0 -1
  148. package/dist/factory/options/option.js +0 -48
  149. package/dist/factory/options/option.js.map +0 -1
  150. package/dist/factory/options/proto.d.ts +0 -19
  151. package/dist/factory/options/proto.d.ts.map +0 -1
  152. package/dist/factory/options/proto.js +0 -2
  153. package/dist/factory/options/proto.js.map +0 -1
  154. package/dist/factory/options/scopes/html.d.ts.map +0 -1
  155. package/dist/factory/options/scopes/html.js.map +0 -1
  156. package/dist/factory/options/scopes/js.d.ts.map +0 -1
  157. package/dist/factory/options/scopes/js.js.map +0 -1
  158. package/dist/factory/options/scopes/json.d.ts.map +0 -1
  159. package/dist/factory/options/scopes/json.js.map +0 -1
  160. package/dist/factory/options/scopes/jsonc.d.ts.map +0 -1
  161. package/dist/factory/options/scopes/jsonc.js.map +0 -1
  162. package/dist/factory/options/scopes/mocha.d.ts.map +0 -1
  163. package/dist/factory/options/scopes/mocha.js.map +0 -1
  164. package/dist/factory/options/scopes/svelte.d.ts.map +0 -1
  165. package/dist/factory/options/scopes/svelte.js.map +0 -1
  166. package/dist/factory/options/scopes/ts.d.ts.map +0 -1
  167. package/dist/factory/options/scopes/ts.js.map +0 -1
  168. package/dist/factory/options/scopes/yml.d.ts.map +0 -1
  169. package/dist/factory/options/scopes/yml.js.map +0 -1
  170. package/dist/factory/scoped.d.ts +0 -13
  171. package/dist/factory/scoped.d.ts.map +0 -1
  172. package/dist/factory/scoped.js +0 -17
  173. package/dist/factory/scoped.js.map +0 -1
  174. package/src/config/index.ts +0 -42
  175. package/src/config/rule.ts +0 -14
  176. package/src/factory/global.ts +0 -45
  177. package/src/factory/options/option.ts +0 -98
  178. package/src/factory/options/proto.ts +0 -46
  179. package/src/factory/options/scopes/html.ts +0 -16
  180. package/src/factory/options/scopes/js.ts +0 -11
  181. package/src/factory/options/scopes/json.ts +0 -16
  182. package/src/factory/options/scopes/jsonc.ts +0 -16
  183. package/src/factory/options/scopes/mocha.ts +0 -29
  184. package/src/factory/options/scopes/ts.ts +0 -28
  185. package/src/factory/options/scopes/yml.ts +0 -17
  186. package/src/factory/scoped.ts +0 -17
  187. /package/dist/factory/{options → settings}/index.js +0 -0
  188. /package/dist/{config → interface/config}/index.js +0 -0
  189. /package/dist/{config → interface/config}/rule.js +0 -0
@@ -0,0 +1,48 @@
1
+ import type globals from "globals";
2
+ import type { Scopes } from "../../index.js";
3
+ export declare abstract class ScopeSetting<S extends Scopes, ParserOptions extends object | boolean = false, ParserCount extends 0 | 1 | 2 = ParserOptions extends false ? 0 : 1, G extends keyof typeof globals & ("mocha") | false = false, Processor extends object = object, Language extends object = object> {
4
+ readonly parser: readonly unknown[] & {
5
+ length: ParserCount;
6
+ };
7
+ abstract readonly scope: S;
8
+ abstract readonly processor: (Processor extends never ? object : Processor extends {
9
+ readonly processor: infer P;
10
+ } ? string extends P ? object : {
11
+ readonly processor: P;
12
+ } : object);
13
+ abstract readonly language: (Language extends never ? object : Language extends {
14
+ readonly language: infer L;
15
+ } ? string extends L ? object : {
16
+ readonly language: L;
17
+ } : object);
18
+ constructor(parser: readonly unknown[] & {
19
+ length: ParserCount;
20
+ });
21
+ get option(): {
22
+ readonly languageOptions: (G extends never ? object : G extends boolean ? object : G extends string ? string extends G ? object : {
23
+ readonly globals: Readonly<Record<string, unknown>>;
24
+ } : object) & ParserOptions extends never ? object : ParserOptions extends boolean ? ParserOptions extends true ? {
25
+ readonly parser: unknown;
26
+ } : object : {
27
+ readonly parser: unknown;
28
+ readonly parserOptions: ParserOptions;
29
+ };
30
+ } & (Processor extends never ? object : Processor extends {
31
+ readonly processor: infer P;
32
+ } ? string extends P ? object : {
33
+ readonly processor: P;
34
+ } : object) & (Language extends never ? object : Language extends {
35
+ readonly language: infer L;
36
+ } ? string extends L ? object : {
37
+ readonly language: L;
38
+ } : object);
39
+ protected abstract get languageOptions(): (G extends never ? object : G extends boolean ? object : G extends string ? string extends G ? object : {
40
+ readonly globals: Readonly<Record<string, unknown>>;
41
+ } : object) & ParserOptions extends never ? object : ParserOptions extends boolean ? ParserOptions extends true ? {
42
+ readonly parser: unknown;
43
+ } : object : {
44
+ readonly parser: unknown;
45
+ readonly parserOptions: ParserOptions;
46
+ };
47
+ }
48
+ //# sourceMappingURL=setting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setting.d.ts","sourceRoot":"","sources":["../../../src/factory/settings/setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,8BAAsB,YAAY,CAChC,CAAC,SAAS,MAAM,EAChB,aAAa,SACX,MAAM,GACN,OAAO,GAAG,KAAK,EACjB,WAAW,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,aAAa,SAAS,KAAK,GAAG,CAAC,GAAG,CAAC,EACnE,CAAC,SAAS,MAAM,OAAO,OAAO,GAAG,CAC7B,OAAO,CACV,GAAG,KAAK,GAAG,KAAK,EACjB,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,QAAQ,SAAS,MAAM,GAAG,MAAM;aAiBJ,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE;IAfhF,kBAAyB,KAAK,EAAE,CAAC,CAAC;IAClC,kBAAyB,SAAS,EAAE,CAAC,SAAS,SAAS,KAAK,GACxD,MAAM,GACN,SAAS,SAAS;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;KAAE,GAC/C,MAAM,SAAS,CAAC,GACd,MAAM,GACN;QAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAA;KAAE,GAC3B,MAAM,CAAC,CAAC;IACd,kBAAyB,QAAQ,EAAE,CAAC,QAAQ,SAAS,KAAK,GACtD,MAAM,GACN,QAAQ,SAAS;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;KAAE,GAC7C,MAAM,SAAS,CAAC,GACd,MAAM,GACN;QAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;KAAE,GAC1B,MAAM,CAAC,CAAC;gBACc,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE;IAEhF,IAAW,MAAM;;8BAqBe,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;6BAMpC,OAAO;;6BAET,OAAO;oCAA0B,aAAa;;;4BA3C7B,MAAM,CAAC;;4BAGrB,CAAC;;2BAIW,MAAM,CAAC;;2BAGpB,CAAC;gBAe7B;IAED,SAAS,CAAC,QAAQ,KAAK,eAAe,IACpC,CAAC,CAAC,SAAS,KAAK,GACZ,MAAM,GACN,CAAC,SAAS,OAAO,GACf,MAAM,GACN,CAAC,SAAS,MAAM,GACd,MAAM,SAAS,CAAC,GACd,MAAM,GACN;QAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;KAAE,GACzD,MAAM,CACb,GAAG,aAAa,SAAS,KAAK,GAC3B,MAAM,GACN,aAAa,SAAS,OAAO,GAC3B,aAAa,SAAS,IAAI,GACxB;QAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;KAAE,GAC5B,MAAM,GACR;QAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAA;KAAE,CAAC;CAC7E"}
@@ -0,0 +1,20 @@
1
+ export class ScopeSetting {
2
+ parser;
3
+ constructor(parser) {
4
+ this.parser = parser;
5
+ }
6
+ get option() {
7
+ try {
8
+ const { languageOptions, processor, language } = this;
9
+ return {
10
+ languageOptions,
11
+ ...processor,
12
+ ...language,
13
+ };
14
+ }
15
+ catch (e) {
16
+ throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e });
17
+ }
18
+ }
19
+ }
20
+ //# sourceMappingURL=setting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setting.js","sourceRoot":"","sources":["../../../src/factory/settings/setting.ts"],"names":[],"mappings":"AAGA,MAAM,OAAgB,YAAY;IA2BJ;IAA5B,YAA4B,MAAoD;QAApD,WAAM,GAAN,MAAM,CAA8C;IAAG,CAAC;IAEpF,IAAW,MAAM;QACf,IAAI,CAAC;YACH,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;YAEtD,OAAO;gBACL,eAAe;gBACf,GAAG,SAAS;gBACZ,GAAG,QAAQ;aACH,CAAC;QACb,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,KAAK,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAAC,CAAC;IACnG,CAAC;CAmBF"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { Input, Output } from "./interface/index.js";
2
2
  export type { Scopes } from "./scopes.js";
3
3
  export type * from "./interface/index.js";
4
- export type * from "./config/index.js";
5
- export default function ({ imports: { plugins, parsers, }, defaults, extensions, }: Input): Output;
4
+ export default function ({ imports: { plugins, parsers }, defaults, extensions, }: Input): Output;
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AASvC,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,UAAU,CAAC;AAC9B,MAAM,CAAC,OAAO,WACZ,EACE,OAAO,EAAE,EACP,OAAO,EACP,OAAO,GACR,EACD,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,GACP,MAAM,CA6DR"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,mBAAmB,aAAa,CAAC;AACjC,MAAM,CAAC,OAAO,WAAW,EACvB,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAC7B,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,GAAG,MAAM,CAwBhB"}
package/dist/index.js CHANGED
@@ -1,28 +1,22 @@
1
1
  import { scopes } from "./scopes.js";
2
- import { GlobalFactory, ScopeFactory, Options, } from "./factory/index.js";
3
- export default function ({ imports: { plugins, parsers, }, defaults, extensions, }) {
2
+ import { Factory, Options } from "./factory/index.js";
3
+ export default function ({ imports: { plugins, parsers }, defaults, extensions, }) {
4
4
  try {
5
- const global = new GlobalFactory(plugins, defaults.settings, defaults.ignores["*"], extensions["*"]), factory = new ScopeFactory(defaults, extensions), options = {
6
- js: new Options
7
- .js([], ...factory.produce("js")).configs,
8
- ts: new Options
9
- .ts([parsers.ts], ...factory.produce("ts")).configs,
10
- svelte: new Options
11
- .svelte([parsers.svelte, parsers.ts], ...factory.produce("svelte")).configs,
12
- mocha: new Options
13
- .mocha([parsers.ts], ...factory.produce("mocha")).configs,
14
- html: new Options
15
- .html([parsers.html], ...factory.produce("html")).configs,
16
- json: new Options
17
- .json([parsers.jsonc], ...factory.produce("json")).configs,
18
- jsonc: new Options
19
- .jsonc([parsers.jsonc], ...factory.produce("jsonc")).configs,
20
- yml: new Options
21
- .yml([parsers.yml], ...factory.produce("yml")).configs,
5
+ const factory = new Factory(defaults, extensions), options = {
6
+ js: new Options.js([]),
7
+ ts: new Options.ts([parsers.ts]),
8
+ svelte: new Options.svelte([parsers.svelte, parsers.ts]),
9
+ mocha: new Options.mocha([parsers.ts]),
10
+ html: new Options.html([parsers.html]),
11
+ json: new Options.json([parsers.jsonc]),
12
+ jsonc: new Options.jsonc([parsers.jsonc]),
13
+ yml: new Options.yml([parsers.yml]),
22
14
  };
23
15
  return [
24
- ...global.configs,
25
- ...scopes.flatMap(scope => options[scope]),
16
+ { name: `linted/*/plugins`, plugins },
17
+ factory.settings,
18
+ factory.ignores,
19
+ ...scopes.flatMap(scope => factory.scope(scope, options[scope])),
26
20
  ];
27
21
  }
28
22
  catch (e) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,aAAa,EACb,YAAY,EACZ,OAAO,GACR,MAAM,WAAW,CAAC;AAInB,MAAM,CAAC,OAAO,WACZ,EACE,OAAO,EAAE,EACP,OAAO,EACP,OAAO,GACR,EACD,QAAQ,EACR,UAAU,GACJ;IAER,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,aAAa,CAC9B,OAAO,EACP,QAAQ,CAAC,QAAQ,EACjB,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EACrB,UAAU,CAAC,GAAG,CAAC,CAChB,EACD,OAAO,GAAG,IAAI,YAAY,CACxB,QAAQ,EACR,UAAU,CACX,EACD,OAAO,GAAiF;YACtF,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,EAAE,EACF,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CACzB,CAAC,OAAO;YACX,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,CAAC,OAAO,CAAC,EAAE,CAAC,EACZ,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CACzB,CAAC,OAAO;YACX,MAAM,EAAE,IAAI,OAAO;iBAChB,MAAM,CACL,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,EAC5B,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAC7B,CAAC,OAAO;YACX,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,CAAC,OAAO,CAAC,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rule from "./rule.js";
2
+ export type { Rule };
3
+ export interface Config<Plugins extends string = string> {
4
+ readonly name: `linted/${string}`;
5
+ readonly plugins: Readonly<Record<Plugins, {
6
+ readonly configs: unknown;
7
+ }>>;
8
+ readonly files: readonly string[];
9
+ readonly ignores: readonly string[];
10
+ readonly rules: Rule.Config;
11
+ readonly linterOptions: {
12
+ readonly noInlineConfig: boolean;
13
+ readonly reportUnusedDisableDirectives: "error" | "warn" | "off";
14
+ };
15
+ readonly languageOptions: {
16
+ readonly sourceType: "module" | "script";
17
+ readonly ecmaVersion: "latest" | 3 | 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024;
18
+ };
19
+ readonly processor?: string;
20
+ readonly language?: string;
21
+ readonly settings?: Readonly<Record<string, unknown>>;
22
+ }
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,QAAQ,CAAC;AAEpC,YAAY,EAAE,IAAI,EAAE,CAAC;AACrB,MAAM,WAAW,MAAM,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IACrD,QAAQ,CAAC,IAAI,EAAE,UAAU,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;IAC3E,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE;QACtB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;QACjC,QAAQ,CAAC,6BAA6B,EAClC,OAAO,GACP,MAAM,GACN,KAAK,CACR;KACF,CAAC;IACF,QAAQ,CAAC,eAAe,EAAE;QACxB,QAAQ,CAAC,UAAU,EACf,QAAQ,GACR,QAAQ,CACX;QACD,QAAQ,CAAC,WAAW,EAChB,QAAQ,GACR,CAAC,GACD,CAAC,GACD,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CACP;KACF,CAAC;IACF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/config/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export type Entry = readonly [
2
+ string,
3
+ Config
4
+ ];
5
+ export type Config = Readonly<Record<string, State | readonly [State, ...readonly unknown[]]>>;
6
+ export type State = ("error" | "warn" | "off");
7
+ //# sourceMappingURL=rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule.d.ts","sourceRoot":"","sources":["../../../src/interface/config/rule.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,SAAS;IAC3B,MAAM;IACN,MAAM;CACP,CAAC;AACF,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAClC,MAAM,EACJ,KAAK,GACL,SAAS,CAAC,KAAK,EAAE,GAAG,SAAS,OAAO,EAAE,CAAC,CAC1C,CAAC,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAChB,OAAO,GACP,MAAM,GACN,KAAK,CACR,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rule.js","sourceRoot":"","sources":["../../src/config/rule.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"rule.js","sourceRoot":"","sources":["../../../src/interface/config/rule.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { Config } from "../../index.js";
2
+ import type { Only } from "./only/index.js";
3
+ export type Ignores = Only<Config, ({
4
+ readonly name: `linted/*/ignores`;
5
+ } & Pick<Config, "ignores">)>;
6
+ //# sourceMappingURL=ignores.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ignores.d.ts","sourceRoot":"","sources":["../../../../src/interface/configs/globals/ignores.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,MAAM,OAAO,GAAG,IAAI,CACxB,MAAM,EACN,CACI;IAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GACrC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAC1B,CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ignores.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ignores.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/ignores.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export type * from "./plugins.js";
2
+ export type * from "./settings.js";
3
+ export type * from "./ignores.js";
4
+ export type * from "./only/index.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/configs/globals/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,YAAY,CAAC;AAChC,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type Only<Base extends object, This extends object> = This & Readonly<Partial<Record<Exclude<keyof Base, keyof This>, never>>>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/interface/configs/globals/only/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,CACd,IAAI,SAAS,MAAM,EACnB,IAAI,SAAS,MAAM,IACjB,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/interface/configs/globals/only/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { Config, Imports } from "../../index.js";
2
+ import type { Only } from "./only/index.js";
3
+ export type Plugins = Only<Config, ({
4
+ readonly name: `linted/*/plugins`;
5
+ } & Pick<Config<Imports.Plugins>, "plugins">)>;
6
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../src/interface/configs/globals/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,MAAM,OAAO,GAAG,IAAI,CACxB,MAAM,EACN,CACI;IAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GACrC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAC3C,CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/plugins.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type { Config } from "../../index.js";
2
+ import type { Only } from "./only/index.js";
3
+ export type Settings = Only<Config, ({
4
+ readonly name: `linted/*/settings`;
5
+ readonly languageOptions: Pick<Config["languageOptions"], "ecmaVersion" | "sourceType">;
6
+ } & Pick<Config, "linterOptions">)>;
7
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/interface/configs/globals/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,MAAM,QAAQ,GAAG,IAAI,CACzB,MAAM,EACN,CACI;IACA,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC,CAAC;CACzF,GACC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,CAChC,CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/settings.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export type * as Globals from "./globals/index.js";
2
+ export type * from "./scoped.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/configs/index.ts"],"names":[],"mappings":"AAAA,YAAY,KAAK,OAAO,MAAM,WAAW,CAAC;AAC1C,mBAAmB,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/interface/configs/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type { Config } from "../index.js";
2
+ import type { Scopes } from "../../index.js";
3
+ export type Scoped = {
4
+ readonly name: `linted/${Scopes}:${string}`;
5
+ readonly languageOptions: Omit<Config["languageOptions"], "sourceType" | "ecmaVersion">;
6
+ } & Pick<Config, "files" | "ignores" | "rules" | "processor" | "language" | "settings">;
7
+ //# sourceMappingURL=scoped.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoped.d.ts","sourceRoot":"","sources":["../../../src/interface/configs/scoped.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,IAAI,EAAE,UAAU,MAAM,IAAI,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC;CACzF,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=scoped.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoped.js","sourceRoot":"","sources":["../../../src/interface/configs/scoped.ts"],"names":[],"mappings":""}
@@ -1,3 +1,3 @@
1
- export type ImportPlugins = ("@stylistic" | "@typescript-eslint" | "svelte" | "mocha" | "@html-eslint" | "jsonc" | "yml");
2
- export type ImportParsers = ("ts" | "svelte" | "html" | "jsonc" | "yml");
3
- //# sourceMappingURL=index.d.ts.map
1
+ export type * from "./plugins.js";
2
+ export type * from "./parsers.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/imports/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,CACxB,YAAY,GACZ,oBAAoB,GACpB,QAAQ,GACR,OAAO,GACP,cAAc,GACd,OAAO,GACP,KAAK,CACR,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,CACxB,IAAI,GACJ,QAAQ,GACR,MAAM,GACN,OAAO,GACP,KAAK,CACR,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/imports/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type Parsers = ("ts" | "svelte" | "html" | "jsonc" | "yml");
2
+ //# sourceMappingURL=parsers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../src/interface/imports/parsers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAClB,IAAI,GACJ,QAAQ,GACR,MAAM,GACN,OAAO,GACP,KAAK,CACR,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=parsers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../../src/interface/imports/parsers.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type Plugins = ("@stylistic" | "@typescript-eslint" | "svelte" | "mocha" | "@html-eslint" | "jsonc" | "yml");
2
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/interface/imports/plugins.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAClB,YAAY,GACZ,oBAAoB,GACpB,QAAQ,GACR,OAAO,GACP,cAAc,GACd,OAAO,GACP,KAAK,CACR,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/interface/imports/plugins.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
+ export type * as Imports from "./imports/index.js";
2
+ export type * from "./config/index.js";
1
3
  export type * from "./input.js";
2
4
  export type * from "./output.js";
3
- export type * from "./imports/index.js";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,SAAS,CAAC;AAC7B,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,YAAY,KAAK,OAAO,MAAM,WAAW,CAAC;AAC1C,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,SAAS,CAAC;AAC7B,mBAAmB,UAAU,CAAC"}
@@ -1,18 +1,18 @@
1
- import type { Scopes, Config, RuleEntry } from "../index.js";
2
- import type { ImportPlugins, ImportParsers } from "./imports/index.js";
1
+ import type { Config, Rule, Imports } from "./index.js";
2
+ import type { Scopes } from "../index.js";
3
3
  export interface Input {
4
- imports: {
5
- plugins: Config<ImportPlugins>["plugins"];
6
- parsers: Record<ImportParsers & Scopes, unknown>;
4
+ readonly imports: {
5
+ readonly plugins: Config<Imports.Plugins>["plugins"];
6
+ readonly parsers: Readonly<Record<Imports.Parsers, unknown>>;
7
7
  };
8
- defaults: {
9
- settings: Config["linterOptions"] & Pick<Config["languageOptions"], "ecmaVersion" | "sourceType">;
10
- files: Record<"*" | Scopes, string[]>;
11
- ignores: Input["defaults"]["files"];
12
- rules: Record<Scopes, RuleEntry[]>;
8
+ readonly defaults: {
9
+ readonly settings: Config["linterOptions"] & Pick<Config["languageOptions"], "ecmaVersion" | "sourceType">;
10
+ readonly files: Readonly<Record<"*" | Scopes, readonly string[]>>;
11
+ readonly ignores: Input["defaults"]["files"];
12
+ readonly rules: Readonly<Record<Scopes, readonly Rule.Entry[]>>;
13
13
  };
14
- extensions: Partial<Record<"*", Partial<Input["defaults"]["settings"] & Pick<Config, "ignores"> & {
15
- override?: boolean;
16
- }>> & Record<Scopes, Partial<Pick<Config, "files" | "ignores" | "rules">>>>;
14
+ readonly extensions: Readonly<Partial<Record<"*", Partial<Input["defaults"]["settings"] & Pick<Config, "ignores"> & {
15
+ readonly override?: boolean;
16
+ }>> & Record<Scopes, Partial<Pick<Config, "files" | "ignores" | "rules">>>>>;
17
17
  }
18
18
  //# sourceMappingURL=input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/interface/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EACN,SAAS,EACV,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE9D,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC;QAC1C,OAAO,EAAE,MAAM,CACb,aAAa,GAAG,MAAM,EACtB,OAAO,CACR,CAAC;KACH,CAAC;IACF,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,aAAa,G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AAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;QAClE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC;QAC7C,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KACjE,CAAC;IACF,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CACjC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,GAC/G,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CACvE,CAAC,CAAC;CACJ"}
@@ -1,17 +1,9 @@
1
- import type { Scopes, Config } from "../index.js";
2
- import type { ImportPlugins } from "./imports/index.js";
3
- export type Exclusive<Base extends object, Cool extends object> = Cool & Partial<Record<Exclude<keyof Base, keyof Cool>, never>>;
4
- export type Output = [
5
- Exclusive<Config, {
6
- name: `linted/*/settings`;
7
- languageOptions: Pick<Config["languageOptions"], "ecmaVersion" | "sourceType">;
8
- } & Pick<Config<ImportPlugins>, "plugins" | "linterOptions">>,
9
- Exclusive<Config, {
10
- name: `linted/*/ignores`;
11
- } & Pick<Config, "ignores">>,
12
- ...({
13
- name: `linted/${Scopes}:${string}`;
14
- languageOptions: Omit<Config["languageOptions"], "sourceType" | "ecmaVersion">;
15
- } & Pick<Config, "files" | "ignores" | "rules" | "processor" | "language" | "settings">)[]
1
+ import type * as Configs from "./configs/index.js";
2
+ export type { Configs };
3
+ export type Output = readonly [
4
+ Configs.Globals.Plugins,
5
+ Configs.Globals.Settings,
6
+ Configs.Globals.Ignores,
7
+ ...readonly Configs.Scoped[]
16
8
  ];
17
9
  //# sourceMappingURL=output.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/interface/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EACP,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,MAAM,SAAS,CAAC,IAAI,SAAS,MAAM,EAAE,IAAI,SAAS,MAAM,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACjI,MAAM,MAAM,MAAM,GAAG;IACnB,SAAS,CACP,MAAM,EACN;QACE,IAAI,EAAE,mBAAmB,CAAC;QAC1B,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC,CAAC;KAChF,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,SAAS,GAAG,eAAe,CAAC,CAC7D;IACD,SAAS,CACP,MAAM,EACN;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,GAAG,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CACvD;IACD,GAAG,CAAC;QACF,IAAI,EAAE,UAAU,MAAM,IAAI,MAAM,EAAE,CAAC;QACnC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC;KAChF,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC,EAAE;CAC3F,CAAC"}
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/interface/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,CAAC;AAE1C,YAAY,EAAE,OAAO,EAAE,CAAC;AACxB,MAAM,MAAM,MAAM,GAAG,SAAS;IAC5B,OAAO,CAAC,OAAO,CAAC,OAAO;IACvB,OAAO,CAAC,OAAO,CAAC,QAAQ;IACxB,OAAO,CAAC,OAAO,CAAC,OAAO;IACvB,GAAG,SAAS,OAAO,CAAC,MAAM,EAAE;CAC7B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_schemaVersion": "22.11.0",
3
3
  "name": "@eslinted/core",
4
- "version": "13.0.0-rc.1",
4
+ "version": "13.1.0-rc.1",
5
5
  "description": "Core ESLint flat config factory npm package `linted`.",
6
6
  "keywords": [],
7
7
  "repository": "github:jimmy-zhening-luo/linted-core",
@@ -0,0 +1,89 @@
1
+ import type { Scopes, Input } from "..";
2
+ import { Ruleset } from "./ruleset";
3
+ import type Options from "./settings";
4
+
5
+ export class Factory {
6
+ public readonly extensions: {
7
+ readonly global: NonNullable<Input["extensions"]["*"]>;
8
+ readonly scopes: Omit<Input["extensions"], "*">;
9
+ };
10
+
11
+ constructor(
12
+ public readonly defaults: Input["defaults"],
13
+ { "*": global = {}, ...scopes }: Input["extensions"] = {} as const,
14
+ ) {
15
+ this.extensions = { global, scopes } as const;
16
+ }
17
+
18
+ public get settings() {
19
+ const {
20
+ defaults: { settings },
21
+ extensions: {
22
+ global: {
23
+ noInlineConfig = settings.noInlineConfig,
24
+ reportUnusedDisableDirectives = settings.reportUnusedDisableDirectives,
25
+ sourceType = settings.sourceType,
26
+ ecmaVersion = settings.ecmaVersion,
27
+ },
28
+ },
29
+ } = this;
30
+
31
+ return {
32
+ name: "linted/*/settings",
33
+ linterOptions: { noInlineConfig, reportUnusedDisableDirectives } as const,
34
+ languageOptions: { sourceType, ecmaVersion } as const,
35
+ } as const;
36
+ }
37
+
38
+ public get ignores() {
39
+ const {
40
+ defaults: { ignores: { "*": defaults } },
41
+ extensions: {
42
+ global: {
43
+ ignores = [] as const,
44
+ override = false,
45
+ },
46
+ },
47
+ } = this;
48
+
49
+ return {
50
+ name: "linted/*/ignores",
51
+ ignores: [
52
+ ...override ? [] as const : defaults,
53
+ ...ignores,
54
+ ] as const,
55
+ } as const;
56
+ }
57
+
58
+ public scope<S extends Scopes>(scope: S, settings: InstanceType<typeof Options[S]>) {
59
+ const {
60
+ defaults: {
61
+ files: { [scope]: defaultFiles },
62
+ ignores: { [scope]: defaultIgnores },
63
+ rules: { [scope]: defaultRules },
64
+ },
65
+ extensions: { scopes: { [scope]: scopeExtension = {} as const } },
66
+ } = this,
67
+ {
68
+ files: extendFiles = [] as const,
69
+ ignores: extendIgnores = [] as const,
70
+ rules: extendRules,
71
+ } = scopeExtension,
72
+ files = [...defaultFiles, ...extendFiles] as const,
73
+ ignores = [...defaultIgnores, ...extendIgnores] as const,
74
+ ruleset = new Ruleset(scope, defaultRules, extendRules);
75
+
76
+ if (ruleset.scope !== settings.scope)
77
+ throw new TypeError(`Scope mismatch between config "${settings.scope} and inner ruleset "${ruleset.scope}"`);
78
+
79
+ return files.length < 1
80
+ ? [] as const
81
+ : ruleset.ruleset.map(({ id, rules }) => ({
82
+ name: `linted/${id}`,
83
+ files,
84
+ ignores,
85
+ rules,
86
+ ...settings.option,
87
+ } as const));
88
+ }
89
+ }
@@ -1,5 +1,4 @@
1
- export * from "./global";
2
- export * from "./scoped";
3
- import Options from "./options";
1
+ export * from "./factory";
2
+ import Options from "./settings";
4
3
 
5
4
  export { Options };