@eslinted/core 13.0.0 → 13.1.0-rc.2

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 +4 -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 +5991 -0
  49. package/dist/factory/settings/setting.d.ts.map +1 -0
  50. package/dist/factory/settings/setting.js +26 -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 +28 -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 +68 -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
@@ -1 +0,0 @@
1
- {"version":3,"file":"option.d.ts","sourceRoot":"","sources":["../../../src/factory/options/option.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EACP,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAErC,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,MAAM,CAClC,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;aAkBd,MAAM,EAAE,OAAO,EAAE,GAAG;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE;aAC3C,KAAK,EAAE,MAAM,EAAE;aACf,OAAO,EAAE,MAAM,EAAE;aACjB,OAAO,EAAE,OAAO;IAnBlC,kBAAyB,KAAK,EAAE,CAAC,CAAC;IAClC,kBAAyB,SAAS,EAAE,CAAC,SAAS,SAAS,KAAK,GACxD,MAAM,GACN,SAAS,SAAS;QAAE,SAAS,EAAE,MAAM,CAAC,CAAA;KAAE,GACtC,MAAM,SAAS,CAAC,GACd,MAAM,GACN;QAAE,SAAS,EAAE,CAAC,CAAA;KAAE,GAClB,MAAM,CAAC,CAAC;IACd,kBAAyB,QAAQ,EAAE,CAAC,Q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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM3B"}
@@ -1,48 +0,0 @@
1
- import globals from "globals";
2
- export default class Option {
3
- parser;
4
- files;
5
- ignores;
6
- ruleset;
7
- constructor(parser, files, ignores, ruleset) {
8
- this.parser = parser;
9
- this.files = files;
10
- this.ignores = ignores;
11
- this.ruleset = ruleset;
12
- }
13
- get configs() {
14
- const { scope, files, ignores, ruleset, option, } = this;
15
- if (ruleset.scope !== scope)
16
- throw new TypeError(`Scope mismatch between option and ruleset`, { cause: { option: scope, ruleset: ruleset.scope } });
17
- return files.length < 1
18
- ? []
19
- : ruleset.ruleset.map(({ id, rules }) => {
20
- return {
21
- name: `linted/${id}`,
22
- files,
23
- ignores,
24
- rules,
25
- ...option,
26
- };
27
- });
28
- }
29
- get option() {
30
- try {
31
- const { languageOptions, processor, language, } = this;
32
- return {
33
- languageOptions,
34
- ...processor,
35
- ...language,
36
- };
37
- }
38
- catch (e) {
39
- throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e });
40
- }
41
- }
42
- globals(group) {
43
- if (typeof group !== "string")
44
- throw new TypeError(`Expected string`);
45
- return globals[group];
46
- }
47
- }
48
- //# sourceMappingURL=option.js.map
@@ -1 +0,0 @@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BAA+B,IAAI,CAAC,KAAK,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAAC,CAAC;IACnG,CAAC;IAIS,OAAO,CAAC,KAAQ;QACxB,IAAI,OAAO,KAAK,KAAK,QAAQ;YAC3B,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAC;QAEzC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF"}
@@ -1,19 +0,0 @@
1
- export type OptionProto<ParserOptions extends object | boolean, G extends string | boolean, Processor extends object, Language extends object> = ({
2
- languageOptions: (G extends never ? object : G extends boolean ? object : G extends string ? string extends G ? object : {
3
- globals: Record<string, unknown>;
4
- } : object) & (ParserOptions extends never ? object : ParserOptions extends boolean ? ParserOptions extends true ? {
5
- parser: unknown;
6
- } : object : {
7
- parser: unknown;
8
- parserOptions: ParserOptions;
9
- });
10
- } & (Processor extends never ? object : Processor extends {
11
- processor: infer P;
12
- } ? string extends P ? object : {
13
- processor: P;
14
- } : object) & (Language extends never ? object : Language extends {
15
- language: infer L;
16
- } ? string extends L ? object : {
17
- language: L;
18
- } : object));
19
- //# sourceMappingURL=proto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proto.d.ts","sourceRoot":"","sources":["../../../src/factory/options/proto.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CACrB,aAAa,SACX,MAAM,GACN,OAAO,EACT,CAAC,SAAS,MAAM,GAAG,OAAO,EAC1B,SAAS,SAAS,MAAM,EACxB,QAAQ,SAAS,MAAM,IACrB,CACJ;IAAE,eAAe,EAAE,CAAC,CAAC,SAAS,KAAK,GAC/B,MAAM,GACN,CAAC,SAAS,OAAO,GACf,MAAM,GACN,CAAC,SAAS,MAAM,GACd,MAAM,SAAS,CAAC,GACd,MAAM,GACN;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GACtC,MAAM,CACb,GACC,CACC,aAAa,SAAS,KAAK,GACvB,MAAM,GACN,aAAa,SAAS,OAAO,GAC3B,aAAa,SAAS,IAAI,GACxB;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GACnB,MAAM,GACR;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,aAAa,CAAA;KAAE,CACzD,CAAC;CAAE,GACF,CACE,SAAS,SAAS,KAAK,GACnB,MAAM,GACN,SAAS,SAAS;IAAE,SAAS,EAAE,MAAM,CAAC,CAAA;CAAE,GACtC,MAAM,SAAS,CAAC,GACd,MAAM,GACN;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,GAClB,MAAM,CACX,GACC,CACF,QAAQ,SAAS,KAAK,GAClB,MAAM,GACN,QAAQ,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;CAAE,GACpC,MAAM,SAAS,CAAC,GACd,MAAM,GACN;IAAE,QAAQ,EAAE,CAAC,CAAA;CAAE,GACjB,MAAM,CACX,CACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=proto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proto.js","sourceRoot":"","sources":["../../../src/factory/options/proto.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/scopes/html.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,MAAM,CACtC,MAAM,EACN,IAAI,CACL;IACC,SAAgB,KAAK,UAAU;IAC/B,SAAgB,SAAS,KAAM;IAC/B,SAAgB,QAAQ,KAAM;IAE9B,IAAW,eAAe;;MAIzB;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"html.js","sourceRoot":"","sources":["../../../../src/factory/options/scopes/html.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,MAGjC;IACiB,KAAK,GAAG,MAAM,CAAC;IACf,SAAS,GAAG,EAAE,CAAC;IACf,QAAQ,GAAG,EAAE,CAAC;IAE9B,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/scopes/js.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,EAAG,SAAQ,MAAM,CAAC,IAAI,CAAC;IAC1C,SAAgB,KAAK,QAAQ;IAC7B,SAAgB,SAAS,KAAM;IAC/B,SAAgB,QAAQ,KAAM;IAE9B,IAAW,eAAe,OAEzB;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"js.js","sourceRoot":"","sources":["../../../../src/factory/options/scopes/js.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,EAAG,SAAQ,MAAY;IAC1B,KAAK,GAAG,IAAI,CAAC;IACb,SAAS,GAAG,EAAE,CAAC;IACf,QAAQ,GAAG,EAAE,CAAC;IAE9B,IAAW,eAAe;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/scopes/json.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,MAAM,CACtC,MAAM,EACN,IAAI,CACL;IACC,SAAgB,KAAK,UAAU;IAC/B,SAAgB,SAAS,KAAM;IAC/B,SAAgB,QAAQ,KAAM;IAE9B,IAAW,eAAe;;MAIzB;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/factory/options/scopes/json.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,MAGjC;IACiB,KAAK,GAAG,MAAM,CAAC;IACf,SAAS,GAAG,EAAE,CAAC;IACf,QAAQ,GAAG,EAAE,CAAC;IAE9B,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/scopes/jsonc.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,MAAM,CACvC,OAAO,EACP,IAAI,CACL;IACC,SAAgB,KAAK,WAAW;IAChC,SAAgB,SAAS,KAAM;IAC/B,SAAgB,QAAQ,KAAM;IAE9B,IAAW,eAAe;;MAIzB;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonc.js","sourceRoot":"","sources":["../../../../src/factory/options/scopes/jsonc.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,MAGlC;IACiB,KAAK,GAAG,OAAO,CAAC;IAChB,SAAS,GAAG,EAAE,CAAC;IACf,QAAQ,GAAG,EAAE,CAAC;IAE9B,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/scopes/mocha.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,MAAM,CACvC,OAAO,EACP,EAAE,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,eAAe,CAAC,EAChD,CAAC,EACD,OAAO,CACR;IACC,SAAgB,KAAK,WAAW;IAChC,SAAgB,SAAS,KAAM;IAC/B,SAAgB,QAAQ,KAAM;IAC9B,SAAgB,KAAK,qBAAsB;IAE3C,IAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAazB;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mocha.js","sourceRoot":"","sources":["../../../../src/factory/options/scopes/mocha.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAG/B,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,MAKlC;IACiB,KAAK,GAAG,OAAO,CAAC;IAChB,SAAS,GAAG,EAAE,CAAC;IACf,QAAQ,GAAG,EAAE,CAAC;IACd,KAAK,GAAG,CAAC,OAAO,CAAU,CAAC;IAE3C,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,EAC5B,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAEhC,OAAO;YACL,MAAM;YACN,aAAa,EAAE;gBACb,OAAO,EAAE,eAAe;gBACxB,UAAU,EAAE,QAAQ;gBACpB,WAAW,EAAE,IAAI;aAClB;YACD,OAAO;SACC,CAAC;IACb,CAAC;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"svelte.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/scopes/svelte.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,MAAM,CACxC,QAAQ,EACR;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,mBAAmB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC3C,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,eAAe,CAAC,EACpD,CAAC,EACD,KAAK,EACL;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,CAC/B;IACC,SAAgB,KAAK,YAAY;IACjC,SAAgB,SAAS;;MAA2C;IACpE,SAAgB,QAAQ,KAAM;IAE9B,IAAW,eAAe;;;;;;;;;MAazB;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"svelte.js","sourceRoot":"","sources":["../../../../src/factory/options/scopes/svelte.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAG/B,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,MASnC;IACiB,KAAK,GAAG,QAAQ,CAAC;IACjB,SAAS,GAAG,EAAE,SAAS,EAAE,eAAe,EAAW,CAAC;IACpD,QAAQ,GAAG,EAAE,CAAC;IAE9B,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAEvC,OAAO;YACL,MAAM;YACN,aAAa,EAAE;gBACb,MAAM,EAAE,QAAQ;gBAChB,mBAAmB,EAAE,CAAC,SAAS,CAAU;gBACzC,OAAO,EAAE,eAAe;gBACxB,UAAU,EAAE,QAAQ;gBACpB,WAAW,EAAE,IAAI;aAClB;SACO,CAAC;IACb,CAAC;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ts.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/scopes/ts.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,EAAG,SAAQ,MAAM,CACpC,IAAI,EACJ;IACE,OAAO,EAAE,eAAe,CAAC;IACzB,UAAU,EAAE,QAAQ,CAAC;IACrB,WAAW,EAAE,IAAI,CAAC;CACnB,EACD,CAAC,CACF;IACC,SAAgB,KAAK,QAAQ;IAC7B,SAAgB,SAAS,KAAM;IAC/B,SAAgB,QAAQ,KAAM;IAE9B,IAAW,eAAe;;;;;;;MAWzB;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ts.js","sourceRoot":"","sources":["../../../../src/factory/options/scopes/ts.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,EAAG,SAAQ,MAQ/B;IACiB,KAAK,GAAG,IAAI,CAAC;IACb,SAAS,GAAG,EAAE,CAAC;IACf,QAAQ,GAAG,EAAE,CAAC;IAE9B,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO;YACL,MAAM;YACN,aAAa,EAAE;gBACb,OAAO,EAAE,eAAe;gBACxB,UAAU,EAAE,QAAQ;gBACpB,WAAW,EAAE,IAAI;aAClB;SACO,CAAC;IACb,CAAC;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"yml.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/scopes/yml.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,MAAM,CACrC,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,KAAK,SAAS;IAC9B,SAAgB,SAAS,KAAM;IAC/B,SAAgB,QAAQ,KAAM;IAE9B,IAAW,eAAe;;MAIzB;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"yml.js","sourceRoot":"","sources":["../../../../src/factory/options/scopes/yml.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,MAIhC;IACiB,KAAK,GAAG,KAAK,CAAC;IACd,SAAS,GAAG,EAAE,CAAC;IACf,QAAQ,GAAG,EAAE,CAAC;IAE9B,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
@@ -1,13 +0,0 @@
1
- import type { Input, Scopes } from "../index.js";
2
- import { Ruleset } from "./ruleset.js";
3
- export declare class ScopeFactory {
4
- readonly defaultScopes: Pick<Input["defaults"], "files" | "ignores" | "rules">;
5
- readonly extensions: Omit<Input["extensions"], "*">;
6
- constructor(defaultScopes: Pick<Input["defaults"], "files" | "ignores" | "rules">, extensions: Omit<Input["extensions"], "*">);
7
- produce(scope: Scopes): readonly [
8
- string[],
9
- string[],
10
- Ruleset
11
- ];
12
- }
13
- //# sourceMappingURL=scoped.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scoped.d.ts","sourceRoot":"","sources":["../../src/factory/scoped.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,YAAY;aAEL,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;aACrE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC;gBAD1C,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,EACrE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC;IAGrD,OAAO,CAAC,KAAK,EAAE,MAAM;CAO7B"}
@@ -1,17 +0,0 @@
1
- import { Ruleset } from "./ruleset.js";
2
- export class ScopeFactory {
3
- defaultScopes;
4
- extensions;
5
- constructor(defaultScopes, extensions) {
6
- this.defaultScopes = defaultScopes;
7
- this.extensions = extensions;
8
- }
9
- produce(scope) {
10
- return [
11
- [...this.defaultScopes.files[scope], ...this.extensions[scope]?.files ?? []],
12
- [...this.defaultScopes.ignores[scope], ...this.extensions[scope]?.ignores ?? []],
13
- new Ruleset(scope, this.defaultScopes.rules[scope], this.extensions[scope]?.rules),
14
- ];
15
- }
16
- }
17
- //# sourceMappingURL=scoped.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scoped.js","sourceRoot":"","sources":["../../src/factory/scoped.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,YAAY;IAEL;IACA;IAFlB,YACkB,aAAqE,EACrE,UAA0C;QAD1C,kBAAa,GAAb,aAAa,CAAwD;QACrE,eAAU,GAAV,UAAU,CAAgC;IACzD,CAAC;IAEG,OAAO,CAAC,KAAa;QAC1B,OAAO;YACL,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,IAAI,EAAE,CAAa;YACxF,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,IAAI,EAAE,CAAa;YAC5F,IAAI,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;SAC1E,CAAC;IACb,CAAC;CACF"}
@@ -1,42 +0,0 @@
1
- import type { RuleRecord } from "./rule";
2
-
3
- export type * from "./rule";
4
- export interface Config<Plugins extends string = string> {
5
- name: `linted/${string}`;
6
- plugins: Record<Plugins, { configs: unknown }>;
7
- files: string[];
8
- ignores: string[];
9
- rules: RuleRecord;
10
- linterOptions: {
11
- noInlineConfig: boolean;
12
- reportUnusedDisableDirectives:
13
- | "error"
14
- | "warn"
15
- | "off"
16
- ;
17
- };
18
- languageOptions: {
19
- sourceType:
20
- | "module"
21
- | "script"
22
- ;
23
- ecmaVersion:
24
- | "latest"
25
- | 3
26
- | 5
27
- | 2015
28
- | 2016
29
- | 2017
30
- | 2018
31
- | 2019
32
- | 2020
33
- | 2021
34
- | 2022
35
- | 2023
36
- | 2024
37
- ;
38
- };
39
- processor?: string;
40
- language?: string;
41
- settings?: Record<string, unknown>;
42
- }
@@ -1,14 +0,0 @@
1
- export type RuleEntry = readonly [
2
- string,
3
- RuleRecord,
4
- ];
5
- export type RuleRecord = Record<
6
- string,
7
- | RuleState
8
- | readonly [RuleState, ...unknown[]]
9
- >;
10
- export type RuleState = (
11
- | "error"
12
- | "warn"
13
- | "off"
14
- );
@@ -1,45 +0,0 @@
1
- import type { Input } from "..";
2
-
3
- export class GlobalFactory {
4
- constructor(
5
- public readonly plugins: Input["imports"]["plugins"],
6
- public readonly defaultSettings: Input["defaults"]["settings"],
7
- public readonly defaultGlobalIgnores: Input["defaults"]["ignores"]["*"],
8
- public readonly globalExtensions: Input["extensions"]["*"] = {},
9
- ) {}
10
-
11
- public get configs() {
12
- const {
13
- plugins,
14
- defaultSettings,
15
- defaultGlobalIgnores,
16
- globalExtensions,
17
- } = this;
18
-
19
- return [
20
- {
21
- name: "linted/*/settings",
22
- plugins,
23
- linterOptions: {
24
- noInlineConfig: globalExtensions?.noInlineConfig ?? defaultSettings.noInlineConfig,
25
- reportUnusedDisableDirectives: globalExtensions?.reportUnusedDisableDirectives ?? defaultSettings.reportUnusedDisableDirectives,
26
- },
27
- languageOptions: {
28
- sourceType: globalExtensions?.sourceType ?? defaultSettings.sourceType,
29
- ecmaVersion: globalExtensions?.ecmaVersion ?? defaultSettings.ecmaVersion,
30
- },
31
- },
32
- {
33
- name: "linted/*/ignores",
34
- ignores: typeof globalExtensions?.ignores === "undefined" || globalExtensions.ignores.length < 1
35
- ? defaultGlobalIgnores
36
- : [
37
- ...globalExtensions.override === true
38
- ? []
39
- : defaultGlobalIgnores,
40
- ...globalExtensions.ignores,
41
- ],
42
- },
43
- ] as const;
44
- }
45
- }
@@ -1,98 +0,0 @@
1
- import globals from "globals";
2
- import type {
3
- Scopes,
4
- Output,
5
- } from "../..";
6
- import type { Ruleset } from "../ruleset";
7
- import type { OptionProto } from ".";
8
-
9
- export default abstract class Option<
10
- S extends Scopes,
11
- ParserOptions extends
12
- | object
13
- | boolean = false,
14
- ParserCount extends 0 | 1 | 2 = ParserOptions extends false ? 0 : 1,
15
- G extends keyof typeof globals & (
16
- | "mocha"
17
- ) | false = false,
18
- Processor extends object = object,
19
- Language extends object = object,
20
- > {
21
- public abstract readonly scope: S;
22
- public abstract readonly processor: (Processor extends never
23
- ? object
24
- : Processor extends { processor: infer P }
25
- ? string extends P
26
- ? object
27
- : { processor: P }
28
- : object);
29
- public abstract readonly language: (Language extends never
30
- ? object
31
- : Language extends { language: infer L }
32
- ? string extends L
33
- ? object
34
- : { language: L }
35
- : object);
36
- constructor(
37
- public readonly parser: unknown[] & { length: ParserCount },
38
- public readonly files: string[],
39
- public readonly ignores: string[],
40
- public readonly ruleset: Ruleset,
41
- ) {}
42
-
43
- public get configs(): Output[2][] {
44
- const {
45
- scope,
46
- files,
47
- ignores,
48
- ruleset,
49
- option,
50
- } = this;
51
-
52
- if (ruleset.scope !== scope)
53
- throw new TypeError(`Scope mismatch between option and ruleset`, { cause: { option: scope, ruleset: ruleset.scope } });
54
-
55
- return files.length < 1
56
- ? []
57
- : ruleset.ruleset.map(({ id, rules }) => {
58
- return {
59
- name: `linted/${id}`,
60
- files,
61
- ignores,
62
- rules,
63
- ...option,
64
- };
65
- });
66
- }
67
-
68
- private get option() {
69
- try {
70
- const {
71
- languageOptions,
72
- processor,
73
- language,
74
- } = this;
75
-
76
- return {
77
- languageOptions,
78
- ...processor,
79
- ...language,
80
- } satisfies OptionProto<
81
- ParserOptions,
82
- G,
83
- Processor,
84
- Language
85
- >;
86
- }
87
- catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e }); }
88
- }
89
-
90
- protected abstract get languageOptions(): OptionProto<ParserOptions, G, Processor, Language>["languageOptions"];
91
-
92
- protected globals(group: G) {
93
- if (typeof group !== "string")
94
- throw new TypeError(`Expected string`);
95
-
96
- return globals[group];
97
- }
98
- }
@@ -1,46 +0,0 @@
1
- export type OptionProto<
2
- ParserOptions extends
3
- | object
4
- | boolean,
5
- G extends string | boolean,
6
- Processor extends object,
7
- Language extends object,
8
- > = (
9
- { languageOptions: (G extends never
10
- ? object
11
- : G extends boolean
12
- ? object
13
- : G extends string
14
- ? string extends G
15
- ? object
16
- : { globals: Record<string, unknown> }
17
- : object
18
- )
19
- & (
20
- ParserOptions extends never
21
- ? object
22
- : ParserOptions extends boolean
23
- ? ParserOptions extends true
24
- ? { parser: unknown }
25
- : object
26
- : { parser: unknown; parserOptions: ParserOptions }
27
- ); }
28
- & (
29
- Processor extends never
30
- ? object
31
- : Processor extends { processor: infer P }
32
- ? string extends P
33
- ? object
34
- : { processor: P }
35
- : object
36
- )
37
- & (
38
- Language extends never
39
- ? object
40
- : Language extends { language: infer L }
41
- ? string extends L
42
- ? object
43
- : { language: L }
44
- : object
45
- )
46
- );
@@ -1,16 +0,0 @@
1
- import Option from "../option";
2
-
3
- export default class Html extends Option<
4
- "html",
5
- true
6
- > {
7
- public readonly scope = "html";
8
- public readonly processor = {};
9
- public readonly language = {};
10
-
11
- public get languageOptions() {
12
- const [parser] = this.parser;
13
-
14
- return { parser } as const;
15
- }
16
- }
@@ -1,11 +0,0 @@
1
- import Option from "../option";
2
-
3
- export default class Js extends Option<"js"> {
4
- public readonly scope = "js";
5
- public readonly processor = {};
6
- public readonly language = {};
7
-
8
- public get languageOptions() {
9
- return {};
10
- }
11
- }
@@ -1,16 +0,0 @@
1
- import Option from "../option";
2
-
3
- export default class Json extends Option<
4
- "json",
5
- true
6
- > {
7
- public readonly scope = "json";
8
- public readonly processor = {};
9
- public readonly language = {};
10
-
11
- public get languageOptions() {
12
- const [parser] = this.parser;
13
-
14
- return { parser } as const;
15
- }
16
- }
@@ -1,16 +0,0 @@
1
- import Option from "../option";
2
-
3
- export default class Jsonc extends Option<
4
- "jsonc",
5
- true
6
- > {
7
- public readonly scope = "jsonc";
8
- public readonly processor = {};
9
- public readonly language = {};
10
-
11
- public get languageOptions() {
12
- const [parser] = this.parser;
13
-
14
- return { parser } as const;
15
- }
16
- }
@@ -1,29 +0,0 @@
1
- import Option from "../option";
2
- import type Ts from "./ts";
3
-
4
- export default class Mocha extends Option<
5
- "mocha",
6
- Ts["option"]["languageOptions"]["parserOptions"],
7
- 1,
8
- "mocha"
9
- > {
10
- public readonly scope = "mocha";
11
- public readonly processor = {};
12
- public readonly language = {};
13
- public readonly types = ["mocha"] as const;
14
-
15
- public get languageOptions() {
16
- const [parser] = this.parser,
17
- globals = this.globals("mocha");
18
-
19
- return {
20
- parser,
21
- parserOptions: {
22
- project: "tsconfig.json",
23
- sourceType: "module",
24
- ecmaVersion: 2023,
25
- },
26
- globals,
27
- } as const;
28
- }
29
- }
@@ -1,28 +0,0 @@
1
- import Option from "../option";
2
-
3
- export default class Ts extends Option<
4
- "ts",
5
- {
6
- project: "tsconfig.json";
7
- sourceType: "module";
8
- ecmaVersion: 2023;
9
- },
10
- 1
11
- > {
12
- public readonly scope = "ts";
13
- public readonly processor = {};
14
- public readonly language = {};
15
-
16
- public get languageOptions() {
17
- const [parser] = this.parser;
18
-
19
- return {
20
- parser,
21
- parserOptions: {
22
- project: "tsconfig.json",
23
- sourceType: "module",
24
- ecmaVersion: 2023,
25
- },
26
- } as const;
27
- }
28
- }
@@ -1,17 +0,0 @@
1
- import Option from "../option";
2
-
3
- export default class Yml extends Option<
4
- "yml",
5
- true,
6
- 1
7
- > {
8
- public readonly scope = "yml";
9
- public readonly processor = {};
10
- public readonly language = {};
11
-
12
- public get languageOptions() {
13
- const [parser] = this.parser;
14
-
15
- return { parser } as const;
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import type { Input, Scopes } from "..";
2
- import { Ruleset } from "./ruleset";
3
-
4
- export class ScopeFactory {
5
- constructor(
6
- public readonly defaultScopes: Pick<Input["defaults"], "files" | "ignores" | "rules">,
7
- public readonly extensions: Omit<Input["extensions"], "*">,
8
- ) {}
9
-
10
- public produce(scope: Scopes) {
11
- return [
12
- [...this.defaultScopes.files[scope], ...this.extensions[scope]?.files ?? []] as string[],
13
- [...this.defaultScopes.ignores[scope], ...this.extensions[scope]?.ignores ?? []] as string[],
14
- new Ruleset(scope, this.defaultScopes.rules[scope], this.extensions[scope]?.rules),
15
- ] as const;
16
- }
17
- }
File without changes
File without changes
File without changes