@eslinted/core 0.5.1 → 0.7.0-rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/dist/boundary/boundary.d.ts +6 -0
  2. package/dist/boundary/boundary.d.ts.map +1 -0
  3. package/dist/boundary/boundary.js +3 -0
  4. package/dist/boundary/boundary.js.map +1 -0
  5. package/dist/boundary/input/input.d.ts +4 -0
  6. package/dist/boundary/input/input.d.ts.map +1 -0
  7. package/dist/boundary/input/input.js +2 -0
  8. package/dist/boundary/input/input.js.map +1 -0
  9. package/dist/boundary/input/parsers/index.d.ts +5 -0
  10. package/dist/boundary/input/parsers/index.d.ts.map +1 -0
  11. package/dist/boundary/input/parsers/index.js +2 -0
  12. package/dist/boundary/input/parsers/index.js.map +1 -0
  13. package/dist/boundary/input/plugins/index.d.ts +32 -0
  14. package/dist/boundary/input/plugins/index.d.ts.map +1 -0
  15. package/dist/boundary/input/plugins/index.js +2 -0
  16. package/dist/boundary/input/plugins/index.js.map +1 -0
  17. package/dist/boundary/output/config/index.d.ts +19 -0
  18. package/dist/boundary/output/config/index.d.ts.map +1 -0
  19. package/dist/boundary/output/config/index.js +2 -0
  20. package/dist/boundary/output/config/index.js.map +1 -0
  21. package/dist/boundary/output/output.d.ts +3 -0
  22. package/dist/boundary/output/output.d.ts.map +1 -0
  23. package/dist/boundary/output/output.js +2 -0
  24. package/dist/boundary/output/output.js.map +1 -0
  25. package/dist/boundary/scopes/scopes.d.ts +4 -0
  26. package/dist/boundary/scopes/scopes.d.ts.map +1 -0
  27. package/dist/boundary/scopes/scopes.js +11 -0
  28. package/dist/boundary/scopes/scopes.js.map +1 -0
  29. package/dist/config/index.d.ts +1 -1
  30. package/dist/config/index.d.ts.map +1 -1
  31. package/dist/factory/Factory.d.ts +6 -0
  32. package/dist/factory/Factory.d.ts.map +1 -0
  33. package/dist/factory/Factory.js +5 -0
  34. package/dist/factory/Factory.js.map +1 -0
  35. package/dist/factory/files/Files.d.ts +8 -0
  36. package/dist/factory/files/Files.d.ts.map +1 -0
  37. package/dist/factory/files/Files.js +15 -0
  38. package/dist/factory/files/Files.js.map +1 -0
  39. package/dist/factory/files/index.d.ts +9 -0
  40. package/dist/factory/files/index.d.ts.map +1 -0
  41. package/dist/factory/files/index.js +11 -0
  42. package/dist/factory/files/index.js.map +1 -0
  43. package/dist/factory/index.d.ts +2 -1
  44. package/dist/factory/index.d.ts.map +1 -1
  45. package/dist/factory/index.js +2 -1
  46. package/dist/factory/index.js.map +1 -1
  47. package/dist/factory/options/Options.d.ts +20 -0
  48. package/dist/factory/options/Options.d.ts.map +1 -0
  49. package/dist/factory/options/Options.js +17 -0
  50. package/dist/factory/options/Options.js.map +1 -0
  51. package/dist/factory/options/option/Option.d.ts +6 -0
  52. package/dist/factory/options/option/Option.d.ts.map +1 -0
  53. package/dist/factory/options/option/Option.js +7 -0
  54. package/dist/factory/options/option/Option.js.map +1 -0
  55. package/dist/factory/options/option/html/index.d.ts +2 -2
  56. package/dist/factory/options/option/html/index.d.ts.map +1 -1
  57. package/dist/factory/options/option/html/index.js +2 -2
  58. package/dist/factory/options/option/html/index.js.map +1 -1
  59. package/dist/factory/options/option/js/index.d.ts +2 -2
  60. package/dist/factory/options/option/js/index.d.ts.map +1 -1
  61. package/dist/factory/options/option/js/index.js +2 -2
  62. package/dist/factory/options/option/js/index.js.map +1 -1
  63. package/dist/factory/options/option/json/index.d.ts +2 -2
  64. package/dist/factory/options/option/json/index.d.ts.map +1 -1
  65. package/dist/factory/options/option/json/index.js +2 -2
  66. package/dist/factory/options/option/json/index.js.map +1 -1
  67. package/dist/factory/options/option/jsonc/index.d.ts +2 -2
  68. package/dist/factory/options/option/jsonc/index.d.ts.map +1 -1
  69. package/dist/factory/options/option/jsonc/index.js +2 -2
  70. package/dist/factory/options/option/jsonc/index.js.map +1 -1
  71. package/dist/factory/options/option/svelte/index.d.ts +2 -2
  72. package/dist/factory/options/option/svelte/index.d.ts.map +1 -1
  73. package/dist/factory/options/option/svelte/index.js +2 -2
  74. package/dist/factory/options/option/svelte/index.js.map +1 -1
  75. package/dist/factory/options/option/ts/index.d.ts +2 -2
  76. package/dist/factory/options/option/ts/index.d.ts.map +1 -1
  77. package/dist/factory/options/option/ts/index.js +2 -2
  78. package/dist/factory/options/option/ts/index.js.map +1 -1
  79. package/dist/factory/options/option/yml/index.d.ts +2 -2
  80. package/dist/factory/options/option/yml/index.d.ts.map +1 -1
  81. package/dist/factory/options/option/yml/index.js +2 -2
  82. package/dist/factory/options/option/yml/index.js.map +1 -1
  83. package/dist/factory/ruleset/Ruleset.d.ts +12 -0
  84. package/dist/factory/ruleset/Ruleset.d.ts.map +1 -0
  85. package/dist/factory/ruleset/Ruleset.js +27 -0
  86. package/dist/factory/ruleset/Ruleset.js.map +1 -0
  87. package/dist/factory/ruleset/rule/Rule.d.ts +6 -0
  88. package/dist/factory/ruleset/rule/Rule.d.ts.map +1 -0
  89. package/dist/factory/ruleset/rule/Rule.js +9 -0
  90. package/dist/factory/ruleset/rule/Rule.js.map +1 -0
  91. package/dist/index.d.ts +4 -5
  92. package/dist/index.d.ts.map +1 -1
  93. package/dist/index.js +21 -20
  94. package/dist/index.js.map +1 -1
  95. package/package.json +6 -3
  96. package/src/boundary/boundary.ts +11 -0
  97. package/src/{module/boundary/index.ts → boundary/input/input.ts} +1 -1
  98. package/src/{module/boundary → boundary/input}/parsers/index.ts +1 -1
  99. package/src/{module/boundary → boundary/input}/plugins/index.ts +1 -1
  100. package/src/{config → boundary/output/config}/index.ts +1 -1
  101. package/src/boundary/output/config/interface/files/IFiles.d.ts +1 -0
  102. package/src/boundary/output/output.ts +3 -0
  103. package/src/factory/Factory.ts +12 -0
  104. package/src/factory/files/Files.ts +15 -0
  105. package/src/factory/options/{index.ts → Options.ts} +1 -1
  106. package/src/factory/options/option/{index.ts → Option.ts} +1 -1
  107. package/src/factory/options/option/html/index.ts +2 -2
  108. package/src/factory/options/option/js/index.ts +2 -2
  109. package/src/factory/options/option/json/index.ts +2 -2
  110. package/src/factory/options/option/jsonc/index.ts +2 -2
  111. package/src/factory/options/option/svelte/index.ts +2 -2
  112. package/src/factory/options/option/ts/index.ts +2 -2
  113. package/src/factory/options/option/yml/index.ts +2 -2
  114. package/src/factory/ruleset/{index.ts → Ruleset.ts} +1 -1
  115. package/src/index.ts +34 -35
  116. package/src/config/files/IFiles.d.ts +0 -1
  117. package/src/factory/index.ts +0 -10
  118. package/src/module/index.ts +0 -9
  119. /package/src/{config → boundary/output/config/interface}/option/IOption.d.ts +0 -0
  120. /package/src/{config → boundary/output/config/interface}/option/language/IOLanguage.d.ts +0 -0
  121. /package/src/{config → boundary/output/config/interface}/option/language/ecma/IOLanguageEcma.d.ts +0 -0
  122. /package/src/{config → boundary/output/config/interface}/option/language/globals/IOLanguageGlobals.d.ts +0 -0
  123. /package/src/{config → boundary/output/config/interface}/option/language/parser/IOLanguageParser.d.ts +0 -0
  124. /package/src/{config → boundary/output/config/interface}/option/language/parserOptions/IOLanguageParserOptions.d.ts +0 -0
  125. /package/src/{config → boundary/output/config/interface}/option/language/source/IOLanguageSource.d.ts +0 -0
  126. /package/src/{config → boundary/output/config/interface}/option/linter/IOLinter.d.ts +0 -0
  127. /package/src/{config → boundary/output/config/interface}/option/name/IOName.d.ts +0 -0
  128. /package/src/{config → boundary/output/config/interface}/option/plugins/IOPlugins.d.ts +0 -0
  129. /package/src/{config → boundary/output/config/interface}/option/processor/IOProcessor.d.ts +0 -0
  130. /package/src/{config → boundary/output/config/interface}/rules/IRules.d.ts +0 -0
  131. /package/src/{config → boundary/output/config/interface}/rules/rule/IRule.d.ts +0 -0
  132. /package/src/{config → boundary/output/config/interface}/rules/rule/state/RuleSeverity.d.ts +0 -0
  133. /package/src/{module/scopes/index.ts → boundary/scopes/scopes.ts} +0 -0
  134. /package/src/factory/ruleset/rule/{index.ts → Rule.ts} +0 -0
@@ -1,5 +1,5 @@
1
- import Option from "../index.js";
1
+ import Option from "../Option.js";
2
2
  export default class YmlOption extends Option<"yml", "yml", true, never, never, never, never, never> {
3
- constructor(plugins: YmlOption["body"]["plugins"], parser: YmlOption["body"]["languageOptions"]["parser"], ...files: string[]);
3
+ constructor(plugins: YmlOption["body"]["plugins"], parser: YmlOption["body"]["languageOptions"]["parser"], files: readonly string[]);
4
4
  }
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/yml/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAAM,CAC3C,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACrC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACtD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/yml/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAAM,CAC3C,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACrC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACtD,KAAK,EAAE,SAAS,MAAM,EAAE;CAe3B"}
@@ -1,6 +1,6 @@
1
- import Option from "../index.js";
1
+ import Option from "../Option.js";
2
2
  export default class YmlOption extends Option {
3
- constructor(plugins, parser, ...files) {
3
+ constructor(plugins, parser, files) {
4
4
  super({
5
5
  name: "linted/scope:yml",
6
6
  files,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/yml/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAStC;IACC,YACE,OAAqC,EACrC,MAAsD,EACtD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,kBAAkB;YACxB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;SAC5B,CACF,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/yml/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAStC;IACC,YACE,OAAqC,EACrC,MAAsD,EACtD,KAAwB;QAExB,KAAK,CACH;YACE,IAAI,EAAE,kBAAkB;YACxB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;SAC5B,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import Rule from "./rule/Rule.js";
2
+ export { Rule };
3
+ export default class Ruleset<Language extends string> {
4
+ readonly language: literalful<Language>;
5
+ readonly ruleset: readonly Rule[];
6
+ readonly overrides: Rule[];
7
+ constructor(language: literalful<Language>, ...ruleset: readonly Rule[]);
8
+ get id(): `ruleset:${literalful<Language>}`;
9
+ get flat(): IRule[];
10
+ override(...overrides: (undefined | IRule)[]): this;
11
+ }
12
+ //# sourceMappingURL=Ruleset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Ruleset.d.ts","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,QAAQ,SAAS,MAAM;aAKhC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IAJhD,SAAgB,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;IACzC,SAAgB,SAAS,EAAE,IAAI,EAAE,CAAM;gBAGrB,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,EAC9C,GAAG,OAAO,EAAE,SAAS,IAAI,EAAE;IAK7B,IAAW,EAAE,sCAEZ;IAED,IAAW,IAAI,YAKd;IAEM,QAAQ,CAAC,GAAG,SAAS,EAAE,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE;CAcpD"}
@@ -0,0 +1,27 @@
1
+ import Rule from "./rule/Rule.js";
2
+ export { Rule };
3
+ export default class Ruleset {
4
+ language;
5
+ ruleset;
6
+ overrides = [];
7
+ constructor(language, ...ruleset) {
8
+ this.language = language;
9
+ this.ruleset = [...ruleset];
10
+ }
11
+ get id() {
12
+ return `ruleset:${this.language}`;
13
+ }
14
+ get flat() {
15
+ return [
16
+ ...this.ruleset.map(rules => rules.rules),
17
+ ...this.overrides.map(rules => rules.rules),
18
+ ];
19
+ }
20
+ override(...overrides) {
21
+ this.overrides.push(...overrides
22
+ .filter(override => typeof override !== "undefined")
23
+ .map(override => new Rule("override", override)));
24
+ return this;
25
+ }
26
+ }
27
+ //# sourceMappingURL=Ruleset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Ruleset.js","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO;IAKR;IAJF,OAAO,CAAkB;IACzB,SAAS,GAAW,EAAE,CAAC;IAEvC,YACkB,QAA8B,EAC9C,GAAG,OAAwB;QADX,aAAQ,GAAR,QAAQ,CAAsB;QAG9C,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,IAAW,EAAE;QACX,OAAO,WAAW,IAAI,CAAC,QAAQ,EAAW,CAAC;IAC7C,CAAC;IAED,IAAW,IAAI;QACb,OAAO;YACL,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;YACzC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;SAC5C,CAAC;IACJ,CAAC;IAEM,QAAQ,CAAC,GAAG,SAAgC;QACjD,IAAI,CAAC,SAAS,CAAC,IAAI,CACjB,GAAG,SAAS;aACT,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,QAAQ,KAAK,WAAW,CAAC;aACnD,GAAG,CACF,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAClB,UAAU,EACV,QAAQ,CACT,CACF,CACJ,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ export default class {
2
+ readonly id: string;
3
+ readonly rules: IRule;
4
+ constructor(id: string, rules: IRule);
5
+ }
6
+ //# sourceMappingURL=Rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../../../src/factory/ruleset/rule/Rule.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO;aAEM,EAAE,EAAE,MAAM;aACV,KAAK,EAAE,KAAK;gBADZ,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,KAAK;CAE/B"}
@@ -0,0 +1,9 @@
1
+ export default class {
2
+ id;
3
+ rules;
4
+ constructor(id, rules) {
5
+ this.id = id;
6
+ this.rules = rules;
7
+ }
8
+ }
9
+ //# sourceMappingURL=Rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rule.js","sourceRoot":"","sources":["../../../../src/factory/ruleset/rule/Rule.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO;IAEM;IACA;IAFlB,YACkB,EAAU,EACV,KAAY;QADZ,OAAE,GAAF,EAAE,CAAQ;QACV,UAAK,GAAL,KAAK,CAAO;IAC3B,CAAC;CACL"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { Ruleset, Rule } from "./factory/index.js";
2
- import type { Scope, Plugins, Parsers } from "./module/index.js";
3
- import type Config from "./config/index.js";
4
- export { Ruleset, Rule };
1
+ import type { Scope, Plugins, Parsers, Config } from "./boundary/boundary.js";
2
+ import { Ruleset, Rule } from "./factory/Factory.js";
5
3
  export type { Scope };
6
- export default function (plugins: Plugins, parsers: Parsers, defaults: Record<Scope, string[]>, includes: Particord<Scope, string[]>, rulesets: {
4
+ export { Ruleset, Rule };
5
+ export default function (plugins: Plugins, parsers: Parsers, base: Record<Scope, string[]>, includes: Particord<Scope, string[]>, rulesets: {
7
6
  [S in Scope]: Ruleset<S>;
8
7
  }, overrides: Particord<Scope, IRule>): Config[];
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,OAAO,EACP,IAAI,EACL,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACzB,YAAY,EAAE,KAAK,EAAE,CAAC;AACtB,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EACjC,QAAQ,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EACpC,QAAQ,EAAE;KAAG,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,EACtC,SAAS,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GACjC,MAAM,EAAE,CA2FV"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,OAAO,EACP,IAAI,EACL,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,KAAK,EAAE,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACzB,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAC7B,QAAQ,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EACpC,QAAQ,EAAE;KAAG,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,EACtC,SAAS,EAAE,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GACjC,MAAM,EAAE,CAyFV"}
package/dist/index.js CHANGED
@@ -1,41 +1,42 @@
1
- import scopes from "./module/index.js";
2
- import { options, Ruleset, Rule, } from "./factory/index.js";
1
+ import scopes from "./boundary/boundary.js";
2
+ import { Options, Files, Ruleset, Rule, } from "./factory/Factory.js";
3
3
  export { Ruleset, Rule };
4
- export default function (plugins, parsers, defaults, includes, rulesets, overrides) {
4
+ export default function (plugins, parsers, base, includes, rulesets, overrides) {
5
5
  try {
6
+ const files = new Files(base, includes);
6
7
  for (const scope of scopes)
7
8
  rulesets[scope].override(overrides[scope]);
8
- const instantiatedOptions = {
9
- js: new options
10
- .js(plugins.js, ...defaults.js, ...includes.js ?? [])
9
+ const options = {
10
+ js: new Options
11
+ .js(plugins.js, files.files("js"))
11
12
  .body,
12
- ts: new options
13
- .ts(plugins.ts, parsers.ts, ...defaults.ts, ...includes.ts ?? [])
13
+ ts: new Options
14
+ .ts(plugins.ts, parsers.ts, files.files("ts"))
14
15
  .body,
15
- svelte: new options
16
- .svelte(plugins.svelte, parsers.svelte, parsers.ts, ...defaults.svelte, ...includes.svelte ?? [])
16
+ svelte: new Options
17
+ .svelte(plugins.svelte, parsers.svelte, parsers.ts, files.files("svelte"))
17
18
  .body,
18
- html: new options
19
- .html(plugins.html, parsers.html, ...defaults.html, ...includes.html ?? [])
19
+ html: new Options
20
+ .html(plugins.html, parsers.html, files.files("html"))
20
21
  .body,
21
- json: new options
22
- .json(plugins.json, parsers.json, ...defaults.json, ...includes.json ?? [])
22
+ json: new Options
23
+ .json(plugins.json, parsers.json, files.files("json"))
23
24
  .body,
24
- jsonc: new options
25
- .jsonc(plugins.jsonc, parsers.jsonc, ...defaults.jsonc, ...includes.jsonc ?? [])
25
+ jsonc: new Options
26
+ .jsonc(plugins.jsonc, parsers.jsonc, files.files("jsonc"))
26
27
  .body,
27
- yml: new options
28
- .yml(plugins.yml, parsers.yml, ...defaults.yml, ...includes.yml ?? [])
28
+ yml: new Options
29
+ .yml(plugins.yml, parsers.yml, files.files("yml"))
29
30
  .body,
30
31
  };
31
32
  return scopes
32
- .map(scope => instantiatedOptions[scope].files.length > 0
33
+ .map(scope => options[scope].files.length > 0
33
34
  ? rulesets[scope]
34
35
  .flat
35
36
  .map(rules => {
36
37
  return {
37
38
  rules,
38
- ...instantiatedOptions[scope],
39
+ ...options[scope],
39
40
  };
40
41
  })
41
42
  : [])
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"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,IAAI;YACP,GAAG,EAAE,IAAI,OAAO;iBACb,GAAG,CACF,OAAO,CAAC,GAAG,EACX,OAAO,CAAC,GAAG,EACX,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CACnB;iBACA,IAAI;SACR,CAAC;QAEF,OAAO,MAAM;aACV,GAAG,CACF,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YACtC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;iBACd,IAAI;iBACJ,GAAG,CACF,KAAK,CAAC,EAAE;gBACN,OAAO;oBACL,KAAK;oBACL,GAAG,OAAO,CAAC,KAAK,CAAC;iBAClB,CAAC;YACJ,CAAC,CACF;YACH,CAAC,CAAC,EAAE,CACP;aACA,IAAI,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,6BAA6B,EAC7B,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAC;IACJ,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@eslinted/core",
3
- "version": "0.5.1",
3
+ "version": "0.7.0-rc.3",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "private": false,
9
9
  "config": {
10
- "PACKAGE_JSON_VERSION": "20.9.1"
10
+ "PACKAGE_JSON_VERSION": "20.10.0"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
@@ -24,13 +24,16 @@
24
24
  },
25
25
  "main": "dist/index.js",
26
26
  "types": "dist/index.d.ts",
27
+ "engines": {
28
+ "node": ">=20.15.0"
29
+ },
27
30
  "peerDependencies": {},
28
31
  "peerDependenciesMeta": {},
29
32
  "optionalDependencies": {},
30
33
  "dependencies": {},
31
34
  "devDependencies": {
32
35
  "eslint": "~8.57.0",
33
- "linted": "~15.2.7",
36
+ "linted": "~15.3.2",
34
37
  "npm-run-all": "^4.1.5",
35
38
  "typescript": "^5.5.3"
36
39
  },
@@ -0,0 +1,11 @@
1
+ import scopes, { type Scope } from "./scopes/scopes.js";
2
+ import type { Plugins, Parsers } from "./input/input.js";
3
+ import type Config from "./output/output.js";
4
+
5
+ export default scopes;
6
+ export type {
7
+ Scope,
8
+ Plugins,
9
+ Parsers,
10
+ Config,
11
+ };
@@ -1,3 +1,3 @@
1
1
  export type { default as Plugins } from "./plugins/index.js";
2
2
  export type { Parsers } from "./parsers/index.js";
3
- export type { Scope } from "../index.js";
3
+ export type { Scope } from "../boundary.js";
@@ -1,4 +1,4 @@
1
- import type { Scope } from "../index.js";
1
+ import type { Scope } from "../input.js";
2
2
 
3
3
  type ParsedScopes = Scope & (
4
4
  | "ts"
@@ -1,4 +1,4 @@
1
- import type { Scope } from "../index.js";
1
+ import type { Scope } from "../input.js";
2
2
 
3
3
  type PluginImport = { configs: unknown };
4
4
 
@@ -1,6 +1,6 @@
1
1
  export default interface Config {
2
2
  rules: IRule;
3
- files: string[];
3
+ files: readonly string[];
4
4
  name: `linted/scope:${string}`;
5
5
  linterOptions: {
6
6
  noInlineConfig: true;
@@ -0,0 +1 @@
1
+ declare interface IFiles { files: readonly string[] }
@@ -0,0 +1,3 @@
1
+ import type Config from "./config/index.js";
2
+
3
+ export type { Config as default };
@@ -0,0 +1,12 @@
1
+ import Options from "./options/Options.js";
2
+ import Files from "./files/Files.js";
3
+ import Ruleset, { Rule } from "./ruleset/Ruleset.js";
4
+ import type { Scope } from "../index.js";
5
+
6
+ export {
7
+ Options,
8
+ Files,
9
+ Ruleset,
10
+ Rule,
11
+ type Scope,
12
+ };
@@ -0,0 +1,15 @@
1
+ import type { Scope } from "../Factory.js";
2
+
3
+ export default class Files {
4
+ constructor(
5
+ private readonly base: Record<Scope, string[]>,
6
+ private readonly includes: Particord<Scope, string[]>,
7
+ ) {}
8
+
9
+ public files(scope: Scope): readonly string[] {
10
+ return [
11
+ ...this.base[scope],
12
+ ...this.includes[scope] ?? [],
13
+ ];
14
+ }
15
+ }
@@ -1,4 +1,4 @@
1
- import type { Scope } from "../index.js";
1
+ import type { Scope } from "../Factory.js";
2
2
  import JsOption from "./option/js/index.js";
3
3
  import TsOption from "./option/ts/index.js";
4
4
  import SvelteOption from "./option/svelte/index.js";
@@ -1,4 +1,4 @@
1
- import type { Scope } from "../index.js";
1
+ import type { Scope } from "../Options.js";
2
2
 
3
3
  export default class Option<
4
4
  S extends Scope,
@@ -1,4 +1,4 @@
1
- import Option from "../index.js";
1
+ import Option from "../Option.js";
2
2
 
3
3
  export default class HtmlOption extends Option<
4
4
  "html",
@@ -13,7 +13,7 @@ export default class HtmlOption extends Option<
13
13
  constructor(
14
14
  plugins: HtmlOption["body"]["plugins"],
15
15
  parser: HtmlOption["body"]["languageOptions"]["parser"],
16
- ...files: string[]
16
+ files: readonly string[],
17
17
  ) {
18
18
  super(
19
19
  {
@@ -1,9 +1,9 @@
1
- import Option from "../index.js";
1
+ import Option from "../Option.js";
2
2
 
3
3
  export default class JsOption extends Option<"js", "@stylistic"> {
4
4
  constructor(
5
5
  plugins: JsOption["body"]["plugins"],
6
- ...files: string[]
6
+ files: readonly string[],
7
7
  ) {
8
8
  super(
9
9
  {
@@ -1,4 +1,4 @@
1
- import Option from "../index.js";
1
+ import Option from "../Option.js";
2
2
 
3
3
  export default class JsonOption extends Option<
4
4
  "json",
@@ -13,7 +13,7 @@ export default class JsonOption extends Option<
13
13
  constructor(
14
14
  plugins: JsonOption["body"]["plugins"],
15
15
  parser: JsonOption["body"]["languageOptions"]["parser"],
16
- ...files: string[]
16
+ files: readonly string[],
17
17
  ) {
18
18
  super(
19
19
  {
@@ -1,4 +1,4 @@
1
- import Option from "../index.js";
1
+ import Option from "../Option.js";
2
2
 
3
3
  export default class JsoncOption extends Option<
4
4
  "jsonc",
@@ -13,7 +13,7 @@ export default class JsoncOption extends Option<
13
13
  constructor(
14
14
  plugins: JsoncOption["body"]["plugins"],
15
15
  parser: JsoncOption["body"]["languageOptions"]["parser"],
16
- ...files: string[]
16
+ files: readonly string[],
17
17
  ) {
18
18
  super(
19
19
  {
@@ -1,4 +1,4 @@
1
- import Option from "../index.js";
1
+ import Option from "../Option.js";
2
2
  import type TsOption from "../ts/index.js";
3
3
 
4
4
  export default class SvelteOption extends Option<
@@ -15,7 +15,7 @@ export default class SvelteOption extends Option<
15
15
  plugins: SvelteOption["body"]["plugins"],
16
16
  svelteParser: SvelteOption["body"]["languageOptions"]["parser"],
17
17
  tsParser: SvelteOption["body"]["languageOptions"]["parserOptions"]["parser"],
18
- ...files: string[]
18
+ files: readonly string[],
19
19
  ) {
20
20
  super(
21
21
  {
@@ -1,4 +1,4 @@
1
- import Option from "../index.js";
1
+ import Option from "../Option.js";
2
2
  import type JsOption from "../js/index.js";
3
3
 
4
4
  export default class TsOption extends Option<
@@ -11,7 +11,7 @@ export default class TsOption extends Option<
11
11
  constructor(
12
12
  plugins: TsOption["body"]["plugins"],
13
13
  parser: unknown,
14
- ...files: string[]
14
+ files: readonly string[],
15
15
  ) {
16
16
  super(
17
17
  {
@@ -1,4 +1,4 @@
1
- import Option from "../index.js";
1
+ import Option from "../Option.js";
2
2
 
3
3
  export default class YmlOption extends Option<
4
4
  "yml",
@@ -13,7 +13,7 @@ export default class YmlOption extends Option<
13
13
  constructor(
14
14
  plugins: YmlOption["body"]["plugins"],
15
15
  parser: YmlOption["body"]["languageOptions"]["parser"],
16
- ...files: string[]
16
+ files: readonly string[],
17
17
  ) {
18
18
  super(
19
19
  {
@@ -1,4 +1,4 @@
1
- import Rule from "./rule/index.js";
1
+ import Rule from "./rule/Rule.js";
2
2
 
3
3
  export { Rule };
4
4
  export default class Ruleset<Language extends string> {
package/src/index.ts CHANGED
@@ -1,103 +1,102 @@
1
- import scopes from "./module/index.js";
2
- import {
3
- options,
4
- Ruleset,
5
- Rule,
6
- } from "./factory/index.js";
1
+ import scopes from "./boundary/boundary.js";
7
2
  import type {
8
3
  Scope,
9
4
  Plugins,
10
5
  Parsers,
11
- } from "./module/index.js";
12
- import type Config from "./config/index.js";
6
+ Config,
7
+ } from "./boundary/boundary.js";
8
+ import {
9
+ Options,
10
+ Files,
11
+ Ruleset,
12
+ Rule,
13
+ } from "./factory/Factory.js";
13
14
 
14
- export { Ruleset, Rule };
15
15
  export type { Scope };
16
+ export { Ruleset, Rule };
16
17
  export default function (
17
18
  plugins: Plugins,
18
19
  parsers: Parsers,
19
- defaults: Record<Scope, string[]>,
20
+ base: Record<Scope, string[]>,
20
21
  includes: Particord<Scope, string[]>,
21
22
  rulesets: { [S in Scope]: Ruleset<S> },
22
23
  overrides: Particord<Scope, IRule>,
23
24
  ): Config[] {
24
25
  try {
26
+ const files = new Files(
27
+ base,
28
+ includes,
29
+ );
30
+
25
31
  for (const scope of scopes)
26
32
  rulesets[scope].override(overrides[scope]);
27
33
 
28
- const instantiatedOptions: {
34
+ const options: {
29
35
  [S in Scope]: InstanceType<
30
- typeof options[S]
36
+ typeof Options[S]
31
37
  >["body"]
32
38
  } = {
33
- js: new options
39
+ js: new Options
34
40
  .js(
35
41
  plugins.js,
36
- ...defaults.js,
37
- ...includes.js ?? [],
42
+ files.files("js"),
38
43
  )
39
44
  .body,
40
- ts: new options
45
+ ts: new Options
41
46
  .ts(
42
47
  plugins.ts,
43
48
  parsers.ts,
44
- ...defaults.ts,
45
- ...includes.ts ?? [],
49
+ files.files("ts"),
46
50
  )
47
51
  .body,
48
- svelte: new options
52
+ svelte: new Options
49
53
  .svelte(
50
54
  plugins.svelte,
51
55
  parsers.svelte,
52
56
  parsers.ts,
53
- ...defaults.svelte,
54
- ...includes.svelte ?? [],
57
+ files.files("svelte"),
55
58
  )
56
59
  .body,
57
- html: new options
60
+ html: new Options
58
61
  .html(
59
62
  plugins.html,
60
63
  parsers.html,
61
- ...defaults.html,
62
- ...includes.html ?? [],
64
+ files.files("html"),
63
65
  )
64
66
  .body,
65
- json: new options
67
+ json: new Options
66
68
  .json(
67
69
  plugins.json,
68
70
  parsers.json,
69
- ...defaults.json,
70
- ...includes.json ?? [],
71
+ files.files("json"),
71
72
  )
72
73
  .body,
73
- jsonc: new options
74
+ jsonc: new Options
74
75
  .jsonc(
75
76
  plugins.jsonc,
76
77
  parsers.jsonc,
77
- ...defaults.jsonc,
78
- ...includes.jsonc ?? [],
78
+ files.files("jsonc"),
79
79
  )
80
80
  .body,
81
- yml: new options
81
+ yml: new Options
82
82
  .yml(
83
83
  plugins.yml,
84
84
  parsers.yml,
85
- ...defaults.yml,
86
- ...includes.yml ?? [],
85
+ files.files("yml"),
87
86
  )
88
87
  .body,
89
88
  };
90
89
 
91
90
  return scopes
92
91
  .map(
93
- scope => instantiatedOptions[scope].files.length > 0
92
+ scope => options[scope].files.length > 0
94
93
  ? rulesets[scope]
95
94
  .flat
96
95
  .map(
97
96
  rules => {
98
97
  return {
99
98
  rules,
100
- ...instantiatedOptions[scope],
99
+ ...options[scope],
101
100
  };
102
101
  },
103
102
  )
@@ -1 +0,0 @@
1
- declare interface IFiles { files: string[] }
@@ -1,10 +0,0 @@
1
- import options from "./options/index.js";
2
- import Ruleset, { Rule } from "./ruleset/index.js";
3
- import type { Scope } from "../index.js";
4
-
5
- export {
6
- options,
7
- Ruleset,
8
- Rule,
9
- type Scope,
10
- };
@@ -1,9 +0,0 @@
1
- import scopes, { type Scope } from "./scopes/index.js";
2
- import type { Plugins, Parsers } from "./boundary/index.js";
3
-
4
- export type {
5
- Scope,
6
- Plugins,
7
- Parsers,
8
- };
9
- export default scopes;