@eslinted/core 0.9.0-rc.4 → 0.9.0-rc.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/dist/boundary/input/{parsers/parsers.d.ts → parsers.d.ts} +2 -2
  2. package/dist/boundary/input/parsers.d.ts.map +1 -0
  3. package/dist/boundary/input/parsers.js.map +1 -0
  4. package/dist/boundary/input/plugins.d.ts +7 -0
  5. package/dist/boundary/input/plugins.d.ts.map +1 -0
  6. package/dist/boundary/input/plugins.js.map +1 -0
  7. package/dist/boundary/input.d.ts +8 -0
  8. package/dist/boundary/input.d.ts.map +1 -0
  9. package/dist/boundary/{input/input.js.map → input.js.map} +1 -1
  10. package/dist/boundary/output/IConfig.d.ts.map +1 -0
  11. package/dist/boundary/output/IConfig.js.map +1 -0
  12. package/dist/boundary/output.d.ts +3 -0
  13. package/dist/boundary/output.d.ts.map +1 -0
  14. package/dist/boundary/{output/output.js.map → output.js.map} +1 -1
  15. package/dist/factory/{Factory.d.ts → factory.d.ts} +1 -1
  16. package/dist/factory/{Factory.js → factory.js} +1 -1
  17. package/dist/factory/files/Files.d.ts.map +1 -1
  18. package/dist/factory/files/Files.js +9 -4
  19. package/dist/factory/files/Files.js.map +1 -1
  20. package/dist/factory/options/option/Option.d.ts +6 -20
  21. package/dist/factory/options/option/Option.d.ts.map +1 -1
  22. package/dist/factory/options/option/Option.js +33 -23
  23. package/dist/factory/options/option/Option.js.map +1 -1
  24. package/dist/factory/options/option/html/index.d.ts.map +1 -1
  25. package/dist/factory/options/option/html/index.js +7 -2
  26. package/dist/factory/options/option/html/index.js.map +1 -1
  27. package/dist/factory/options/option/js/index.d.ts.map +1 -1
  28. package/dist/factory/options/option/js/index.js +9 -4
  29. package/dist/factory/options/option/js/index.js.map +1 -1
  30. package/dist/factory/options/option/json/index.d.ts.map +1 -1
  31. package/dist/factory/options/option/json/index.js +7 -2
  32. package/dist/factory/options/option/json/index.js.map +1 -1
  33. package/dist/factory/options/option/jsonc/index.d.ts.map +1 -1
  34. package/dist/factory/options/option/jsonc/index.js +7 -2
  35. package/dist/factory/options/option/jsonc/index.js.map +1 -1
  36. package/dist/factory/options/option/svelte/index.d.ts.map +1 -1
  37. package/dist/factory/options/option/svelte/index.js +16 -11
  38. package/dist/factory/options/option/svelte/index.js.map +1 -1
  39. package/dist/factory/options/option/ts/index.d.ts.map +1 -1
  40. package/dist/factory/options/option/ts/index.js +14 -9
  41. package/dist/factory/options/option/ts/index.js.map +1 -1
  42. package/dist/factory/options/option/yml/index.d.ts.map +1 -1
  43. package/dist/factory/options/option/yml/index.js +7 -2
  44. package/dist/factory/options/option/yml/index.js.map +1 -1
  45. package/dist/factory/options/{Options.d.ts → options.d.ts} +1 -1
  46. package/dist/factory/options/{Options.d.ts.map → options.d.ts.map} +1 -1
  47. package/dist/factory/options/{Options.js → options.js} +1 -1
  48. package/dist/factory/options/{Options.js.map → options.js.map} +1 -1
  49. package/dist/factory/ruleset/Ruleset.d.ts.map +1 -1
  50. package/dist/factory/ruleset/Ruleset.js +31 -11
  51. package/dist/factory/ruleset/Ruleset.js.map +1 -1
  52. package/dist/index.d.ts +5 -4
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +1 -1
  55. package/dist/index.js.map +1 -1
  56. package/package.json +2 -2
  57. package/src/boundary/input/{parsers/parsers.ts → parsers.ts} +2 -2
  58. package/src/boundary/input/{plugins/plugins.ts → plugins.ts} +2 -2
  59. package/src/boundary/{input/input.ts → input.ts} +2 -2
  60. package/src/boundary/output.ts +3 -0
  61. package/src/factory/factory.ts +1 -1
  62. package/src/factory/files/Files.ts +12 -4
  63. package/src/factory/options/option/Option.ts +69 -49
  64. package/src/factory/options/option/html/index.ts +10 -2
  65. package/src/factory/options/option/js/index.ts +12 -4
  66. package/src/factory/options/option/json/index.ts +10 -2
  67. package/src/factory/options/option/jsonc/index.ts +10 -2
  68. package/src/factory/options/option/svelte/index.ts +19 -11
  69. package/src/factory/options/option/ts/index.ts +17 -9
  70. package/src/factory/options/option/yml/index.ts +10 -2
  71. package/src/factory/ruleset/Ruleset.ts +46 -14
  72. package/src/index.ts +7 -6
  73. package/dist/boundary/boundary.d.ts +0 -11
  74. package/dist/boundary/boundary.d.ts.map +0 -1
  75. package/dist/boundary/boundary.js +0 -2
  76. package/dist/boundary/boundary.js.map +0 -1
  77. package/dist/boundary/input/input.d.ts +0 -8
  78. package/dist/boundary/input/input.d.ts.map +0 -1
  79. package/dist/boundary/input/parsers/parsers.d.ts.map +0 -1
  80. package/dist/boundary/input/parsers/parsers.js.map +0 -1
  81. package/dist/boundary/input/plugins/plugins.d.ts +0 -7
  82. package/dist/boundary/input/plugins/plugins.d.ts.map +0 -1
  83. package/dist/boundary/input/plugins/plugins.js.map +0 -1
  84. package/dist/boundary/output/config/IConfig.d.ts.map +0 -1
  85. package/dist/boundary/output/config/IConfig.js.map +0 -1
  86. package/dist/boundary/output/output.d.ts +0 -3
  87. package/dist/boundary/output/output.d.ts.map +0 -1
  88. package/dist/boundary/scopes/scopes.d.ts +0 -4
  89. package/dist/boundary/scopes/scopes.d.ts.map +0 -1
  90. package/dist/boundary/scopes/scopes.js +0 -11
  91. package/dist/boundary/scopes/scopes.js.map +0 -1
  92. package/dist/factory/_factory.d.ts +0 -5
  93. package/dist/factory/_factory.d.ts.map +0 -1
  94. package/dist/factory/_factory.js +0 -5
  95. package/dist/factory/_factory.js.map +0 -1
  96. package/src/boundary/boundary.ts +0 -12
  97. package/src/boundary/output/output.ts +0 -3
  98. /package/dist/boundary/input/{parsers/parsers.js → parsers.js} +0 -0
  99. /package/dist/boundary/input/{plugins/plugins.js → plugins.js} +0 -0
  100. /package/dist/boundary/{input/input.js → input.js} +0 -0
  101. /package/dist/boundary/output/{config/IConfig.d.ts → IConfig.d.ts} +0 -0
  102. /package/dist/boundary/output/{config/IConfig.js → IConfig.js} +0 -0
  103. /package/dist/boundary/{output/output.js → output.js} +0 -0
  104. /package/dist/factory/{Factory.d.ts.map → factory.d.ts.map} +0 -0
  105. /package/dist/factory/{Factory.js.map → factory.js.map} +0 -0
  106. /package/src/boundary/output/{config/IConfig.ts → IConfig.ts} +0 -0
  107. /package/src/boundary/output/{config/interface → interface}/option/IOption.d.ts +0 -0
  108. /package/src/boundary/output/{config/interface → interface}/option/language/IOLanguage.d.ts +0 -0
  109. /package/src/boundary/output/{config/interface → interface}/option/language/ecma/IOLanguageEcma.d.ts +0 -0
  110. /package/src/boundary/output/{config/interface → interface}/option/language/globals/IOLanguageGlobals.d.ts +0 -0
  111. /package/src/boundary/output/{config/interface → interface}/option/language/source/IOLanguageSource.d.ts +0 -0
  112. /package/src/boundary/output/{config/interface → interface}/option/linter/IOLinter.d.ts +0 -0
  113. /package/src/boundary/output/{config/interface → interface}/option/plugins/IOPlugins.d.ts +0 -0
  114. /package/src/boundary/output/{config/interface → interface}/option/processor/IOProcessor.d.ts +0 -0
  115. /package/src/boundary/output/{config/interface → interface}/rules/IRule.d.ts +0 -0
  116. /package/src/boundary/output/{config/interface → interface}/rules/state/RuleSeverity.d.ts +0 -0
  117. /package/src/factory/options/{Options.ts → options.ts} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { type Scope } from "./scopes/scopes.js";
2
- import type Boundary from "./boundary/boundary.js";
2
+ import type Output from "./boundary/output.js";
3
+ import type Input from "./boundary/input.js";
3
4
  import { Ruleset, Rule } from "./factory/factory.js";
4
- export type { Scope, Boundary };
5
+ export type { Scope, Output };
5
6
  export { Ruleset, Rule };
6
- export default function (plugins: Boundary.Input.Plugins, parsers: Boundary.Input.Parsers, base: Record<Scope, string[]>, includes: Particord<Scope, string[]>, rulesets: {
7
+ export default function (plugins: Input.Plugins, parsers: Input.Parsers, base: Record<Scope, string[]>, includes: Particord<Scope, string[]>, rulesets: {
7
8
  [S in Scope]: Ruleset<S>;
8
- }, overrides: Particord<Scope, IRule>): Boundary.Output[];
9
+ }, overrides: Particord<Scope, IRule>): Output[];
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file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,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,CA0FV"}
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ export default function (plugins, parsers, base, includes, rulesets, overrides)
45
45
  .flat();
46
46
  }
47
47
  catch (e) {
48
- throw new Error(`linted(): Caught exception.`, { cause: e });
48
+ throw new Error(`linted.main`, { cause: e });
49
49
  }
50
50
  }
51
51
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAc,MAAM,oBAAoB,CAAC;AAExD,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,GACL,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACzB,MAAM,CAAC,OAAO,WACZ,OAA+B,EAC/B,OAA+B,EAC/B,IAA6B,EAC7B,QAAoC,EACpC,QAAsC,EACtC,SAAkC;IAElC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,IAAI,EACJ,QAAQ,CACT,EACD,OAAO,GAEH;YACF,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAU;YAC7B,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAU;YACvC,MAAM,EAAE;gBACN,OAAO,CAAC,MAAM;gBACd,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;aACpB;YACV,IAAI,EAAE,CAAC,OAAO,CAA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,KAAK,CAAC,MAAM,CAAC,EACnB,QAAQ,CAAC,IAAI,EACb,GAAG,OAAO,CAAC,IAAI,CAChB;iBACA,OAAO;YACV,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EACpB,QAAQ,CAAC,KAAK,EACd,GAAG,OAAO,CAAC,KAAK,CACjB;iBACA,OAAO;YACV,GAAG,EAAE,IAAI,OAAO;iBACb,GAAG,CACF,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAClB,QAAQ,CAAC,GAAG,EACZ,GAAG,OAAO,CAAC,GAAG,CACf;iBACA,OAAO;SACX,CAAC;QAEF,OAAO,MAAM;aACV,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aAC5B,IAAI,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,aAAa,EACb,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.9.0-rc.4",
3
+ "version": "0.9.0-rc.6",
4
4
  "description": "Core ESLint flat config factory npm package `linted`.",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {},
22
22
  "devDependencies": {
23
23
  "eslint": "~8.57.0",
24
- "linted": "~15.4.6",
24
+ "linted": "~15.4.7",
25
25
  "npm-run-all": "^4.1.5",
26
26
  "typescript": "^5.5.4"
27
27
  },
@@ -1,5 +1,5 @@
1
- import type { Scope } from "../../../scopes/scopes.js";
2
- import type { Options } from "../../../factory/factory.js";
1
+ import type { Scope } from "../../scopes/scopes.js";
2
+ import type { Options } from "../../factory/factory.js";
3
3
 
4
4
  type Parsers = {
5
5
  readonly [S in Scope]: ConstructorParameters<typeof Options[S]>[2] extends readonly [unknown, ...unknown[]]
@@ -1,5 +1,5 @@
1
- import type { Scope } from "../../../scopes/scopes.js";
2
- import type { Options } from "../../../factory/factory.js";
1
+ import type { Scope } from "../../scopes/scopes.js";
2
+ import type { Options } from "../../factory/factory.js";
3
3
 
4
4
  type Plugins = {
5
5
  readonly [S in Scope]: InstanceType<typeof Options[S]>["plugins"];
@@ -1,5 +1,5 @@
1
- import type plugins from "./plugins/plugins.js";
2
- import type parsers from "./parsers/parsers.js";
1
+ import type plugins from "./input/plugins.js";
2
+ import type parsers from "./input/parsers.js";
3
3
 
4
4
  namespace Input {
5
5
  export type Plugins = plugins;
@@ -0,0 +1,3 @@
1
+ import type Output from "./output/IConfig.js";
2
+
3
+ export type { Output as default };
@@ -1,6 +1,6 @@
1
1
  import Ruleset, { Rule } from "./ruleset/Ruleset.js";
2
2
  import Files from "./files/Files.js";
3
- import Options from "./options/Options.js";
3
+ import Options from "./options/options.js";
4
4
 
5
5
  export {
6
6
  Options,
@@ -7,9 +7,17 @@ export default class Files {
7
7
  ) {}
8
8
 
9
9
  public files(scope: Scope): readonly string[] {
10
- return [
11
- ...this.base[scope],
12
- ...this.includes[scope] ?? [],
13
- ];
10
+ try {
11
+ return [
12
+ ...this.base[scope],
13
+ ...this.includes[scope] ?? [],
14
+ ];
15
+ }
16
+ catch (e) {
17
+ throw new Error(
18
+ `linted.factory.Files/scope:${scope}`,
19
+ { cause: e },
20
+ );
21
+ }
14
22
  }
15
23
  }
@@ -1,6 +1,6 @@
1
1
  import type { Scope } from "../../../scopes/scopes.js";
2
- import type Boundary from "../../../boundary/boundary.js";
3
2
  import type { Ruleset } from "../../factory.js";
3
+ import type Output from "../../../boundary/output.js";
4
4
 
5
5
  export default abstract class Option<
6
6
  S extends Scope,
@@ -11,13 +11,17 @@ export default abstract class Option<
11
11
  GlobalTypes extends string = never,
12
12
  Processor extends object = never,
13
13
  > {
14
- public readonly linterOptions = {
14
+ private readonly linterOptions = {
15
15
  noInlineConfig: true,
16
16
  reportUnusedDisableDirectives: "error",
17
17
  } as const;
18
18
 
19
19
  public abstract readonly scope: literalful<S>;
20
- public abstract readonly processor: (Interface<Processor> extends never ? object : Interface<Processor> extends { "interface": string } ? Interface<Processor> : object);
20
+ public abstract readonly processor: Interface<Processor> extends never
21
+ ? object
22
+ : Interface<Processor> extends Readonly<Record<"processor", string>>
23
+ ? Interface<Processor>
24
+ : object;
21
25
 
22
26
  constructor(
23
27
  public readonly files: readonly string[],
@@ -26,62 +30,78 @@ export default abstract class Option<
26
30
  public readonly parser: Tuple<unknown, ParserCount>,
27
31
  ) {}
28
32
 
29
- public get configs(): Boundary.Output[] {
30
- const {
31
- scope,
32
- ruleset,
33
- files,
34
- option,
35
- } = this;
33
+ public get configs(): Output[] {
34
+ try {
35
+ const {
36
+ scope,
37
+ ruleset,
38
+ files,
39
+ option,
40
+ } = this;
36
41
 
37
- if (ruleset.id !== scope)
38
- throw new TypeError(
39
- `Option and Ruleset scope mismatch`,
40
- { cause: { option: scope, ruleset: ruleset.id } },
41
- );
42
- else if (files.length < 1)
43
- return [];
44
- else {
45
- const baseName = `scope:${scope}/rule:${ruleset.id}` as const;
42
+ if (ruleset.id !== scope)
43
+ throw new TypeError(
44
+ `Option and Ruleset scope mismatch`,
45
+ { cause: { option: scope, ruleset: ruleset.id } },
46
+ );
47
+ else if (files.length < 1)
48
+ return [];
49
+ else {
50
+ const baseName = `scope:${scope}/rule:${ruleset.id}` as const;
46
51
 
47
- return ruleset.records.map(
48
- ([ruleId, rules]) => {
49
- const name = `${baseName}+${ruleId}` as const;
52
+ return ruleset.records.map(
53
+ ([ruleId, rules]) => {
54
+ const name = `${baseName}+${ruleId}` as const;
50
55
 
51
- return {
52
- name,
53
- files,
54
- rules,
55
- ...option,
56
- };
57
- },
56
+ return {
57
+ name,
58
+ files,
59
+ rules,
60
+ ...option,
61
+ };
62
+ },
63
+ );
64
+ }
65
+ }
66
+ catch (e) {
67
+ throw new Error(
68
+ `linted.factory.Option/scope:${this.scope}: configs`,
69
+ { cause: e },
58
70
  );
59
71
  }
60
72
  }
61
73
 
62
- public get option() {
63
- const {
64
- plugins,
65
- linterOptions,
66
- languageOptions,
67
- processor,
68
- } = this;
74
+ private get option() {
75
+ try {
76
+ const {
77
+ plugins,
78
+ linterOptions,
79
+ languageOptions,
80
+ processor,
81
+ } = this;
69
82
 
70
- return {
71
- linterOptions,
72
- languageOptions,
73
- plugins,
74
- ...processor,
75
- } satisfies IOption<
76
- PluginId,
77
- IsEcma,
78
- ParserOptions,
79
- GlobalTypes,
80
- Processor
81
- >;
83
+ return {
84
+ linterOptions,
85
+ languageOptions,
86
+ plugins,
87
+ ...processor,
88
+ } satisfies IOption<
89
+ PluginId,
90
+ IsEcma,
91
+ ParserOptions,
92
+ GlobalTypes,
93
+ Processor
94
+ >;
95
+ }
96
+ catch (e) {
97
+ throw new Error(
98
+ `linted.factory.Option/scope:${this.scope}: option`,
99
+ { cause: e },
100
+ );
101
+ }
82
102
  }
83
103
 
84
- public abstract get languageOptions(): IOLanguage<
104
+ protected abstract get languageOptions(): IOLanguage<
85
105
  IsEcma,
86
106
  ParserOptions,
87
107
  GlobalTypes
@@ -11,8 +11,16 @@ export default class HtmlOption extends Option<
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
14
- const [parser] = this.parser;
14
+ try {
15
+ const [parser] = this.parser;
15
16
 
16
- return { parser } as const;
17
+ return { parser } as const;
18
+ }
19
+ catch (e) {
20
+ throw new Error(
21
+ `linted.factory.options.html: languageOptions`,
22
+ { cause: e },
23
+ );
24
+ }
17
25
  }
18
26
  }
@@ -5,9 +5,17 @@ export default class JsOption extends Option<"js", "@stylistic"> {
5
5
  public readonly processor = {};
6
6
 
7
7
  public get languageOptions() {
8
- return {
9
- ecmaVersion: "latest",
10
- sourceType: "module",
11
- } as const;
8
+ try {
9
+ return {
10
+ ecmaVersion: "latest",
11
+ sourceType: "module",
12
+ } as const;
13
+ }
14
+ catch (e) {
15
+ throw new Error(
16
+ `linted.factory.options.js: languageOptions`,
17
+ { cause: e },
18
+ );
19
+ }
12
20
  }
13
21
  }
@@ -11,8 +11,16 @@ export default class JsonOption extends Option<
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
14
- const [parser] = this.parser;
14
+ try {
15
+ const [parser] = this.parser;
15
16
 
16
- return { parser } as const;
17
+ return { parser } as const;
18
+ }
19
+ catch (e) {
20
+ throw new Error(
21
+ `linted.factory.options.json: languageOptions`,
22
+ { cause: e },
23
+ );
24
+ }
17
25
  }
18
26
  }
@@ -11,8 +11,16 @@ export default class JsoncOption extends Option<
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
14
- const [parser] = this.parser;
14
+ try {
15
+ const [parser] = this.parser;
15
16
 
16
- return { parser } as const;
17
+ return { parser } as const;
18
+ }
19
+ catch (e) {
20
+ throw new Error(
21
+ `linted.factory.options.jsonc: languageOptions`,
22
+ { cause: e },
23
+ );
24
+ }
17
25
  }
18
26
  }
@@ -16,19 +16,27 @@ export default class SvelteOption extends Option<
16
16
  public readonly processor = { processor: "svelte/svelte" } as const;
17
17
 
18
18
  public get languageOptions() {
19
- const [parser, tsParser] = this.parser;
19
+ try {
20
+ const [parser, tsParser] = this.parser;
20
21
 
21
- return {
22
- ecmaVersion: "latest",
23
- sourceType: "module",
24
- parser,
25
- parserOptions: {
22
+ return {
26
23
  ecmaVersion: "latest",
27
24
  sourceType: "module",
28
- project: "tsconfig.json",
29
- extraFileExtensions: [".svelte"] as const,
30
- parser: tsParser,
31
- },
32
- } as const;
25
+ parser,
26
+ parserOptions: {
27
+ ecmaVersion: "latest",
28
+ sourceType: "module",
29
+ project: "tsconfig.json",
30
+ extraFileExtensions: [".svelte"] as const,
31
+ parser: tsParser,
32
+ },
33
+ } as const;
34
+ }
35
+ catch (e) {
36
+ throw new Error(
37
+ `linted.factory.options.svelte: languageOptions`,
38
+ { cause: e },
39
+ );
40
+ }
33
41
  }
34
42
  }
@@ -13,17 +13,25 @@ export default class TsOption extends Option<
13
13
  public readonly processor = {} as const;
14
14
 
15
15
  public get languageOptions() {
16
- const [parser] = this.parser;
16
+ try {
17
+ const [parser] = this.parser;
17
18
 
18
- return {
19
- ecmaVersion: "latest",
20
- sourceType: "module",
21
- parser,
22
- parserOptions: {
19
+ return {
23
20
  ecmaVersion: "latest",
24
21
  sourceType: "module",
25
- project: "tsconfig.json",
26
- },
27
- } as const;
22
+ parser,
23
+ parserOptions: {
24
+ ecmaVersion: "latest",
25
+ sourceType: "module",
26
+ project: "tsconfig.json",
27
+ },
28
+ } as const;
29
+ }
30
+ catch (e) {
31
+ throw new Error(
32
+ `linted.factory.options.ts: languageOptions`,
33
+ { cause: e },
34
+ );
35
+ }
28
36
  }
29
37
  }
@@ -11,8 +11,16 @@ export default class YmlOption extends Option<
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
14
- const [parser] = this.parser;
14
+ try {
15
+ const [parser] = this.parser;
15
16
 
16
- return { parser } as const;
17
+ return { parser } as const;
18
+ }
19
+ catch (e) {
20
+ throw new Error(
21
+ `linted.factory.options.yml: languageOptions`,
22
+ { cause: e },
23
+ );
24
+ }
17
25
  }
18
26
  }
@@ -10,31 +10,63 @@ export default class Ruleset<S extends Scope> {
10
10
  private readonly scope: literalful<S>,
11
11
  ...ruleset: readonly Rule[]
12
12
  ) {
13
- this.ruleset = [...ruleset];
13
+ try {
14
+ this.ruleset = [...ruleset];
15
+ }
16
+ catch (e) {
17
+ throw new Error(
18
+ `linted.factory.Ruleset`,
19
+ { cause: e },
20
+ );
21
+ }
14
22
  }
15
23
 
16
24
  public get id() {
17
- const { scope } = this;
25
+ try {
26
+ const { scope } = this;
18
27
 
19
- return scope;
28
+ return scope;
29
+ }
30
+ catch (e) {
31
+ throw new Error(
32
+ `linted.factory.Ruleset: id`,
33
+ { cause: e },
34
+ );
35
+ }
20
36
  }
21
37
 
22
38
  public get records() {
23
- const { ruleset, overrides } = this;
39
+ try {
40
+ const { ruleset, overrides } = this;
24
41
 
25
- return [
26
- ...ruleset.map(rules => [rules.id, rules.rules] as const),
27
- ...overrides === null ? [] : [[overrides.id, overrides.rules] as const] as const,
28
- ];
42
+ return [
43
+ ...ruleset.map(rules => [rules.id, rules.rules] as const),
44
+ ...overrides === null ? [] : [[overrides.id, overrides.rules] as const] as const,
45
+ ];
46
+ }
47
+ catch (e) {
48
+ throw new Error(
49
+ `linted.factory.Ruleset: records`,
50
+ { cause: e },
51
+ );
52
+ }
29
53
  }
30
54
 
31
55
  public override(overrides: undefined | IRule) {
32
- if (typeof overrides !== "undefined")
33
- this.overrides = new Rule(
34
- "override",
35
- overrides,
36
- );
56
+ try {
57
+ if (typeof overrides !== "undefined")
58
+ this.overrides = new Rule(
59
+ "override",
60
+ overrides,
61
+ );
37
62
 
38
- return this;
63
+ return this;
64
+ }
65
+ catch (e) {
66
+ throw new Error(
67
+ `linted.factory.Ruleset: override`,
68
+ { cause: e },
69
+ );
70
+ }
39
71
  }
40
72
  }
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import scopes, { type Scope } from "./scopes/scopes.js";
2
- import type Boundary from "./boundary/boundary.js";
2
+ import type Output from "./boundary/output.js";
3
+ import type Input from "./boundary/input.js";
3
4
  import {
4
5
  Options,
5
6
  Files,
@@ -7,16 +8,16 @@ import {
7
8
  Rule,
8
9
  } from "./factory/factory.js";
9
10
 
10
- export type { Scope, Boundary };
11
+ export type { Scope, Output };
11
12
  export { Ruleset, Rule };
12
13
  export default function (
13
- plugins: Boundary.Input.Plugins,
14
- parsers: Boundary.Input.Parsers,
14
+ plugins: Input.Plugins,
15
+ parsers: Input.Parsers,
15
16
  base: Record<Scope, string[]>,
16
17
  includes: Particord<Scope, string[]>,
17
18
  rulesets: { [S in Scope]: Ruleset<S> },
18
19
  overrides: Particord<Scope, IRule>,
19
- ): Boundary.Output[] {
20
+ ): Output[] {
20
21
  try {
21
22
  const files = new Files(
22
23
  base,
@@ -102,7 +103,7 @@ export default function (
102
103
  }
103
104
  catch (e) {
104
105
  throw new Error(
105
- `linted(): Caught exception.`,
106
+ `linted.main`,
106
107
  { cause: e },
107
108
  );
108
109
  }
@@ -1,11 +0,0 @@
1
- import type input from "./input/input.js";
2
- import type output from "./output/output.js";
3
- declare namespace Boundary {
4
- namespace Input {
5
- type Plugins = input.Plugins;
6
- type Parsers = input.Parsers;
7
- }
8
- type Output = output;
9
- }
10
- export type { Boundary as default };
11
- //# sourceMappingURL=boundary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../src/boundary/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAE7C,kBAAU,QAAQ,CAAC;IACjB,UAAiB,KAAK,CAAC;QACrB,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QACpC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;KACrC;IACD,KAAY,MAAM,GAAG,MAAM,CAAC;CAC7B;AAED,YAAY,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=boundary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boundary.js","sourceRoot":"","sources":["../../src/boundary/boundary.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import type plugins from "./plugins/plugins.js";
2
- import type parsers from "./parsers/parsers.js";
3
- declare namespace Input {
4
- type Plugins = plugins;
5
- type Parsers = parsers;
6
- }
7
- export type { Input as default };
8
- //# sourceMappingURL=input.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/boundary/input/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,kBAAU,KAAK,CAAC;IACd,KAAY,OAAO,GAAG,OAAO,CAAC;IAC9B,KAAY,OAAO,GAAG,OAAO,CAAC;CAC/B;AAED,YAAY,EAAE,KAAK,IAAI,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../../src/boundary/input/parsers/parsers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,CAAC,IAAI,KAAK,GAAG,qBAAqB,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,GACvG,OAAO,GACP,IAAI;CACT,CAAC;AAEF,YAAY,EAAE,OAAO,IAAI,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../../../src/boundary/input/parsers/parsers.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- import type { Scope } from "../../../scopes/scopes.js";
2
- import type { Options } from "../../../factory/factory.js";
3
- type Plugins = {
4
- readonly [S in Scope]: InstanceType<typeof Options[S]>["plugins"];
5
- };
6
- export type { Plugins as default };
7
- //# sourceMappingURL=plugins.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../src/boundary/input/plugins/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,CAAC,IAAI,KAAK,GAAG,YAAY,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;CAClE,CAAC;AAEF,YAAY,EAAE,OAAO,IAAI,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../src/boundary/input/plugins/plugins.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IConfig.d.ts","sourceRoot":"","sources":["../../../../src/boundary/output/config/IConfig.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,OAAO;IAC9B,IAAI,EAAE,SAAS,MAAM,SAAS,MAAM,IAAI,MAAM,EAAE,CAAC;IACjD,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE;QACb,cAAc,EAAE,IAAI,CAAC;QACrB,6BAA6B,EAAE,OAAO,CAAC;KACxC,CAAC;IACF,eAAe,EAAE;QACf,UAAU,CAAC,EACP,QAAQ,GACR,QAAQ,CAAC;QACb,WAAW,CAAC,EAAE,QAAQ,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACzC,CAAC;IACF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IConfig.js","sourceRoot":"","sources":["../../../../src/boundary/output/config/IConfig.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import type Output from "./config/IConfig.js";
2
- export type { Output as default };
3
- //# sourceMappingURL=output.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/boundary/output/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAE9C,YAAY,EAAE,MAAM,IAAI,OAAO,EAAE,CAAC"}