@eslinted/core 0.6.0 → 0.7.0-rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) 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/factory/Factory.d.ts +6 -0
  30. package/dist/factory/Factory.d.ts.map +1 -0
  31. package/dist/factory/Factory.js +5 -0
  32. package/dist/factory/Factory.js.map +1 -0
  33. package/dist/factory/files/Files.d.ts +8 -0
  34. package/dist/factory/files/Files.d.ts.map +1 -0
  35. package/dist/factory/files/Files.js +15 -0
  36. package/dist/factory/files/Files.js.map +1 -0
  37. package/dist/factory/options/Options.d.ts +20 -0
  38. package/dist/factory/options/Options.d.ts.map +1 -0
  39. package/dist/factory/options/Options.js +17 -0
  40. package/dist/factory/options/Options.js.map +1 -0
  41. package/dist/factory/options/option/Option.d.ts +6 -0
  42. package/dist/factory/options/option/Option.d.ts.map +1 -0
  43. package/dist/factory/options/option/Option.js +7 -0
  44. package/dist/factory/options/option/Option.js.map +1 -0
  45. package/dist/factory/options/option/html/index.d.ts +1 -1
  46. package/dist/factory/options/option/html/index.d.ts.map +1 -1
  47. package/dist/factory/options/option/html/index.js +1 -1
  48. package/dist/factory/options/option/html/index.js.map +1 -1
  49. package/dist/factory/options/option/js/index.d.ts +1 -1
  50. package/dist/factory/options/option/js/index.d.ts.map +1 -1
  51. package/dist/factory/options/option/js/index.js +1 -1
  52. package/dist/factory/options/option/js/index.js.map +1 -1
  53. package/dist/factory/options/option/json/index.d.ts +1 -1
  54. package/dist/factory/options/option/json/index.d.ts.map +1 -1
  55. package/dist/factory/options/option/json/index.js +1 -1
  56. package/dist/factory/options/option/json/index.js.map +1 -1
  57. package/dist/factory/options/option/jsonc/index.d.ts +1 -1
  58. package/dist/factory/options/option/jsonc/index.d.ts.map +1 -1
  59. package/dist/factory/options/option/jsonc/index.js +1 -1
  60. package/dist/factory/options/option/jsonc/index.js.map +1 -1
  61. package/dist/factory/options/option/svelte/index.d.ts +1 -1
  62. package/dist/factory/options/option/svelte/index.d.ts.map +1 -1
  63. package/dist/factory/options/option/svelte/index.js +1 -1
  64. package/dist/factory/options/option/svelte/index.js.map +1 -1
  65. package/dist/factory/options/option/ts/index.d.ts +1 -1
  66. package/dist/factory/options/option/ts/index.d.ts.map +1 -1
  67. package/dist/factory/options/option/ts/index.js +1 -1
  68. package/dist/factory/options/option/ts/index.js.map +1 -1
  69. package/dist/factory/options/option/yml/index.d.ts +1 -1
  70. package/dist/factory/options/option/yml/index.d.ts.map +1 -1
  71. package/dist/factory/options/option/yml/index.js +1 -1
  72. package/dist/factory/options/option/yml/index.js.map +1 -1
  73. package/dist/factory/ruleset/Ruleset.d.ts +12 -0
  74. package/dist/factory/ruleset/Ruleset.d.ts.map +1 -0
  75. package/dist/factory/ruleset/Ruleset.js +27 -0
  76. package/dist/factory/ruleset/Ruleset.js.map +1 -0
  77. package/dist/factory/ruleset/rule/Rule.d.ts +6 -0
  78. package/dist/factory/ruleset/rule/Rule.d.ts.map +1 -0
  79. package/dist/factory/ruleset/rule/Rule.js +9 -0
  80. package/dist/factory/ruleset/rule/Rule.js.map +1 -0
  81. package/dist/index.d.ts +3 -4
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +20 -19
  84. package/dist/index.js.map +1 -1
  85. package/package.json +2 -2
  86. package/src/boundary/boundary.ts +11 -0
  87. package/src/{module/boundary/index.ts → boundary/input/input.ts} +1 -1
  88. package/src/{module/boundary → boundary/input}/parsers/index.ts +1 -1
  89. package/src/{module/boundary → boundary/input}/plugins/index.ts +1 -1
  90. package/src/boundary/output/output.ts +3 -0
  91. package/src/factory/Factory.ts +12 -0
  92. package/src/factory/files/Files.ts +15 -0
  93. package/src/factory/options/{index.ts → Options.ts} +1 -1
  94. package/src/factory/options/option/{index.ts → Option.ts} +1 -1
  95. package/src/factory/options/option/html/index.ts +1 -1
  96. package/src/factory/options/option/js/index.ts +1 -1
  97. package/src/factory/options/option/json/index.ts +1 -1
  98. package/src/factory/options/option/jsonc/index.ts +1 -1
  99. package/src/factory/options/option/svelte/index.ts +1 -1
  100. package/src/factory/options/option/ts/index.ts +1 -1
  101. package/src/factory/options/option/yml/index.ts +1 -1
  102. package/src/factory/ruleset/{index.ts → Ruleset.ts} +1 -1
  103. package/src/index.ts +33 -50
  104. package/src/factory/files/index.ts +0 -20
  105. package/src/factory/index.ts +0 -12
  106. package/src/module/index.ts +0 -9
  107. /package/src/{config → boundary/output/config}/index.ts +0 -0
  108. /package/src/{config → boundary/output/config/interface}/files/IFiles.d.ts +0 -0
  109. /package/src/{config → boundary/output/config/interface}/option/IOption.d.ts +0 -0
  110. /package/src/{config → boundary/output/config/interface}/option/language/IOLanguage.d.ts +0 -0
  111. /package/src/{config → boundary/output/config/interface}/option/language/ecma/IOLanguageEcma.d.ts +0 -0
  112. /package/src/{config → boundary/output/config/interface}/option/language/globals/IOLanguageGlobals.d.ts +0 -0
  113. /package/src/{config → boundary/output/config/interface}/option/language/parser/IOLanguageParser.d.ts +0 -0
  114. /package/src/{config → boundary/output/config/interface}/option/language/parserOptions/IOLanguageParserOptions.d.ts +0 -0
  115. /package/src/{config → boundary/output/config/interface}/option/language/source/IOLanguageSource.d.ts +0 -0
  116. /package/src/{config → boundary/output/config/interface}/option/linter/IOLinter.d.ts +0 -0
  117. /package/src/{config → boundary/output/config/interface}/option/name/IOName.d.ts +0 -0
  118. /package/src/{config → boundary/output/config/interface}/option/plugins/IOPlugins.d.ts +0 -0
  119. /package/src/{config → boundary/output/config/interface}/option/processor/IOProcessor.d.ts +0 -0
  120. /package/src/{config → boundary/output/config/interface}/rules/IRules.d.ts +0 -0
  121. /package/src/{config → boundary/output/config/interface}/rules/rule/IRule.d.ts +0 -0
  122. /package/src/{config → boundary/output/config/interface}/rules/rule/state/RuleSeverity.d.ts +0 -0
  123. /package/src/{module/scopes/index.ts → boundary/scopes/scopes.ts} +0 -0
  124. /package/src/factory/ruleset/rule/{index.ts → Rule.ts} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
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 };
4
+ export { Ruleset, Rule };
6
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[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,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,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,CA0GV"}
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, Files, 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
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, new Files("js", { base, includes }).files)
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, new Files("ts", { base, includes }).files)
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, new Files("svelte", { base, includes }).files)
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, new Files("html", { base, includes }).files)
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, new Files("json", { base, includes }).files)
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, new Files("jsonc", { base, includes }).files)
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, new Files("yml", { base, includes }).files)
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":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,GACL,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAEzB,MAAM,CAAC,OAAO,WACZ,OAAgB,EAChB,OAAgB,EAChB,IAA6B,EAC7B,QAAoC,EACpC,QAAsC,EACtC,SAAkC;IAElC,IAAI,CAAC;QACH,KAAK,MAAM,KAAK,IAAI,MAAM;YACxB,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAE7C,MAAM,mBAAmB,GAIrB;YACF,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,OAAO,CAAC,EAAE,EACV,IAAI,KAAK,CACP,IAAI,EACJ,EAAE,IAAI,EAAE,QAAQ,EAAE,CACnB,CAAC,KAAK,CAER;iBACA,IAAI;YACP,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,OAAO,CAAC,EAAE,EACV,OAAO,CAAC,EAAE,EACV,IAAI,KAAK,CACP,IAAI,EACJ,EAAE,IAAI,EAAE,QAAQ,EAAE,CACnB,CAAC,KAAK,CACR;iBACA,IAAI;YACP,MAAM,EAAE,IAAI,OAAO;iBAChB,MAAM,CACL,OAAO,CAAC,MAAM,E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CACH,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,IAAI,EACZ,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CACpB;iBACA,IAAI;YACP,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,IAAI,EACZ,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CACpB;iBACA,IAAI;YACP,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,KAAK,EACb,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CACrB;iBACA,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslinted/core",
3
- "version": "0.6.0",
3
+ "version": "0.7.0-rc.3",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {},
34
34
  "devDependencies": {
35
35
  "eslint": "~8.57.0",
36
- "linted": "~15.3.1",
36
+ "linted": "~15.3.2",
37
37
  "npm-run-all": "^4.1.5",
38
38
  "typescript": "^5.5.3"
39
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
 
@@ -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",
@@ -1,4 +1,4 @@
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(
@@ -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",
@@ -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",
@@ -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<
@@ -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<
@@ -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",
@@ -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,19 +1,19 @@
1
- import scopes from "./module/index.js";
2
- import {
3
- options,
4
- Files,
5
- Ruleset,
6
- Rule,
7
- } from "./factory/index.js";
1
+ import scopes from "./boundary/boundary.js";
8
2
  import type {
9
3
  Scope,
10
4
  Plugins,
11
5
  Parsers,
12
- } from "./module/index.js";
13
- 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";
14
14
 
15
- export { Ruleset, Rule };
16
15
  export type { Scope };
16
+ export { Ruleset, Rule };
17
17
  export default function (
18
18
  plugins: Plugins,
19
19
  parsers: Parsers,
@@ -23,97 +23,80 @@ export default function (
23
23
  overrides: Particord<Scope, IRule>,
24
24
  ): Config[] {
25
25
  try {
26
+ const files = new Files(
27
+ base,
28
+ includes,
29
+ );
30
+
26
31
  for (const scope of scopes)
27
32
  rulesets[scope].override(overrides[scope]);
28
33
 
29
- const instantiatedOptions: {
34
+ const options: {
30
35
  [S in Scope]: InstanceType<
31
- typeof options[S]
36
+ typeof Options[S]
32
37
  >["body"]
33
38
  } = {
34
- js: new options
39
+ js: new Options
35
40
  .js(
36
41
  plugins.js,
37
- new Files(
38
- "js",
39
- { base, includes },
40
- ).files,
41
-
42
+ files.files("js"),
42
43
  )
43
44
  .body,
44
- ts: new options
45
+ ts: new Options
45
46
  .ts(
46
47
  plugins.ts,
47
48
  parsers.ts,
48
- new Files(
49
- "ts",
50
- { base, includes },
51
- ).files,
49
+ files.files("ts"),
52
50
  )
53
51
  .body,
54
- svelte: new options
52
+ svelte: new Options
55
53
  .svelte(
56
54
  plugins.svelte,
57
55
  parsers.svelte,
58
56
  parsers.ts,
59
- new Files(
60
- "svelte",
61
- { base, includes },
62
- ).files,
57
+ files.files("svelte"),
63
58
  )
64
59
  .body,
65
- html: new options
60
+ html: new Options
66
61
  .html(
67
62
  plugins.html,
68
63
  parsers.html,
69
- new Files(
70
- "html",
71
- { base, includes },
72
- ).files,
64
+ files.files("html"),
73
65
  )
74
66
  .body,
75
- json: new options
67
+ json: new Options
76
68
  .json(
77
69
  plugins.json,
78
70
  parsers.json,
79
- new Files(
80
- "json",
81
- { base, includes },
82
- ).files,
71
+ files.files("json"),
83
72
  )
84
73
  .body,
85
- jsonc: new options
74
+ jsonc: new Options
86
75
  .jsonc(
87
76
  plugins.jsonc,
88
77
  parsers.jsonc,
89
- new Files(
90
- "jsonc",
91
- { base, includes },
92
- ).files,
78
+ files.files("jsonc"),
93
79
  )
94
80
  .body,
95
- yml: new options
81
+ yml: new Options
96
82
  .yml(
97
83
  plugins.yml,
98
84
  parsers.yml,
99
- new Files(
100
- "yml",
101
- { base, includes },
102
- ).files,
85
+ files.files("yml"),
103
86
  )
104
87
  .body,
105
88
  };
106
89
 
107
90
  return scopes
108
91
  .map(
109
- scope => instantiatedOptions[scope].files.length > 0
92
+ scope => options[scope].files.length > 0
110
93
  ? rulesets[scope]
111
94
  .flat
112
95
  .map(
113
96
  rules => {
114
97
  return {
115
98
  rules,
116
- ...instantiatedOptions[scope],
99
+ ...options[scope],
117
100
  };
118
101
  },
119
102
  )
@@ -1,20 +0,0 @@
1
- import type { Scope } from "../index.js";
2
-
3
- export default class Files<S extends Scope> {
4
- public readonly files: readonly string[];
5
-
6
- constructor(
7
- scope: S,
8
- filescopes: {
9
- base: Record<Scope, string[]>;
10
- includes: Particord<Scope, string[]>;
11
- },
12
- ) {
13
- const { base, includes } = filescopes;
14
-
15
- this.files = [
16
- ...base[scope],
17
- ...includes[scope] ?? [],
18
- ];
19
- }
20
- }
@@ -1,12 +0,0 @@
1
- import options from "./options/index.js";
2
- import Files from "./files/index.js";
3
- import Ruleset, { Rule } from "./ruleset/index.js";
4
- import type { Scope } from "../index.js";
5
-
6
- export {
7
- options,
8
- Files,
9
- Ruleset,
10
- Rule,
11
- type Scope,
12
- };
@@ -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;
File without changes
File without changes