@eslinted/core 0.8.0-rc.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/boundary/boundary.d.ts +2 -2
  2. package/dist/boundary/boundary.d.ts.map +1 -1
  3. package/dist/boundary/input/plugins/plugins.d.ts +1 -1
  4. package/dist/boundary/input/plugins/plugins.d.ts.map +1 -1
  5. package/dist/boundary/output/config/IConfig.d.ts +1 -1
  6. package/dist/boundary/output/config/IConfig.d.ts.map +1 -1
  7. package/dist/factory/options/option/Option.d.ts +6 -4
  8. package/dist/factory/options/option/Option.d.ts.map +1 -1
  9. package/dist/factory/options/option/Option.js +23 -4
  10. package/dist/factory/options/option/Option.js.map +1 -1
  11. package/dist/factory/options/option/html/index.d.ts +1 -1
  12. package/dist/factory/options/option/html/index.d.ts.map +1 -1
  13. package/dist/factory/options/option/html/index.js +1 -1
  14. package/dist/factory/options/option/html/index.js.map +1 -1
  15. package/dist/factory/options/option/js/index.d.ts +1 -1
  16. package/dist/factory/options/option/js/index.d.ts.map +1 -1
  17. package/dist/factory/options/option/js/index.js +1 -1
  18. package/dist/factory/options/option/js/index.js.map +1 -1
  19. package/dist/factory/options/option/json/index.d.ts +1 -1
  20. package/dist/factory/options/option/json/index.d.ts.map +1 -1
  21. package/dist/factory/options/option/json/index.js +1 -1
  22. package/dist/factory/options/option/json/index.js.map +1 -1
  23. package/dist/factory/options/option/jsonc/index.d.ts +1 -1
  24. package/dist/factory/options/option/jsonc/index.d.ts.map +1 -1
  25. package/dist/factory/options/option/jsonc/index.js +1 -1
  26. package/dist/factory/options/option/jsonc/index.js.map +1 -1
  27. package/dist/factory/options/option/svelte/index.d.ts +1 -1
  28. package/dist/factory/options/option/svelte/index.d.ts.map +1 -1
  29. package/dist/factory/options/option/svelte/index.js +1 -1
  30. package/dist/factory/options/option/svelte/index.js.map +1 -1
  31. package/dist/factory/options/option/ts/index.d.ts +1 -1
  32. package/dist/factory/options/option/ts/index.d.ts.map +1 -1
  33. package/dist/factory/options/option/ts/index.js +1 -1
  34. package/dist/factory/options/option/ts/index.js.map +1 -1
  35. package/dist/factory/options/option/yml/index.d.ts +1 -1
  36. package/dist/factory/options/option/yml/index.d.ts.map +1 -1
  37. package/dist/factory/options/option/yml/index.js +1 -1
  38. package/dist/factory/options/option/yml/index.js.map +1 -1
  39. package/dist/factory/ruleset/Ruleset.d.ts +8 -7
  40. package/dist/factory/ruleset/Ruleset.d.ts.map +1 -1
  41. package/dist/factory/ruleset/Ruleset.js +13 -12
  42. package/dist/factory/ruleset/Ruleset.js.map +1 -1
  43. package/dist/index.d.ts +2 -2
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +15 -24
  46. package/dist/index.js.map +1 -1
  47. package/package.json +1 -1
  48. package/src/boundary/boundary.ts +2 -2
  49. package/src/boundary/input/plugins/plugins.ts +1 -1
  50. package/src/boundary/output/config/IConfig.ts +1 -1
  51. package/src/boundary/output/config/interface/option/IOption.d.ts +0 -3
  52. package/src/factory/options/option/Option.ts +37 -6
  53. package/src/factory/options/option/html/index.ts +1 -1
  54. package/src/factory/options/option/js/index.ts +1 -1
  55. package/src/factory/options/option/json/index.ts +1 -1
  56. package/src/factory/options/option/jsonc/index.ts +1 -1
  57. package/src/factory/options/option/svelte/index.ts +1 -1
  58. package/src/factory/options/option/ts/index.ts +1 -1
  59. package/src/factory/options/option/yml/index.ts +1 -1
  60. package/src/factory/ruleset/Ruleset.ts +18 -18
  61. package/src/index.ts +19 -25
  62. package/types/project/OmitFilesRuleset.d.ts +1 -0
  63. package/src/boundary/output/config/interface/option/name/IOName.d.ts +0 -1
  64. package/types/project/OmitLast.d.ts +0 -1
@@ -1,6 +1,6 @@
1
1
  import scopes, { type Scope } from "./scopes/scopes.js";
2
2
  import type { Plugins, Parsers } from "./input/input.js";
3
- import type Config from "./output/output.js";
3
+ import type IConfig from "./output/output.js";
4
4
  export default scopes;
5
- export type { Scope, Plugins, Parsers, Config, };
5
+ export type { Scope, Plugins, Parsers, IConfig, };
6
6
  //# sourceMappingURL=boundary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../src/boundary/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAE7C,eAAe,MAAM,CAAC;AACtB,YAAY,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,GACP,CAAC"}
1
+ {"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../src/boundary/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,eAAe,MAAM,CAAC;AACtB,YAAY,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,GACR,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { Scope, Options } from "../../../factory/Factory.js";
2
2
  type Plugins = {
3
- [S in Scope]: InstanceType<typeof Options[S]>["plugins"];
3
+ readonly [S in Scope]: InstanceType<typeof Options[S]>["plugins"];
4
4
  };
5
5
  export type { Plugins as default };
6
6
  //# sourceMappingURL=plugins.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../src/boundary/input/plugins/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAElE,KAAK,OAAO,GAAG;KACZ,CAAC,IAAI,KAAK,GAAG,YAAY,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;CACzD,CAAC;AAEF,YAAY,EAAE,OAAO,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../src/boundary/input/plugins/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAElE,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,5 +1,5 @@
1
1
  export default interface IConfig {
2
- name: `scope:${string}`;
2
+ name: `scope:${string}/rule:${string}+${string}`;
3
3
  rules: IRule;
4
4
  files: readonly string[];
5
5
  linterOptions: {
@@ -1 +1 @@
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,EAAE,CAAC;IACxB,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
+ {"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,20 +1,22 @@
1
1
  import type { Scope } from "../Options.js";
2
+ import type { Ruleset } from "../../Factory.js";
3
+ import type { IConfig } from "../../../boundary/boundary.js";
2
4
  export default abstract class Option<S extends Scope, PluginId extends string, IsEcma extends boolean = true, ParserOptions extends object | boolean = false, ParserCount extends 0 | 1 | 2 = 0, GlobalTypes extends string = never, Processor extends object = never> {
3
5
  readonly files: readonly string[];
6
+ readonly ruleset: Ruleset<S>;
4
7
  readonly plugins: IOPlugins<PluginId>;
5
8
  readonly parser: Tuple<unknown, ParserCount>;
6
9
  readonly linterOptions: {
7
10
  readonly noInlineConfig: true;
8
11
  readonly reportUnusedDisableDirectives: "error";
9
12
  };
10
- abstract readonly name: literalful<`scope:${S}`>;
13
+ abstract readonly scope: literalful<S>;
11
14
  abstract readonly processor: (Interface<Processor> extends never ? object : Interface<Processor> extends {
12
15
  "interface": string;
13
16
  } ? Interface<Processor> : object);
14
- constructor(files: readonly string[], plugins: IOPlugins<PluginId>, parser: Tuple<unknown, ParserCount>);
17
+ constructor(files: readonly string[], ruleset: Ruleset<S>, plugins: IOPlugins<PluginId>, parser: Tuple<unknown, ParserCount>);
18
+ get configs(): IConfig[];
15
19
  get option(): {
16
- name: literalful<`scope:${S}`>;
17
- files: readonly string[];
18
20
  linterOptions: {
19
21
  readonly noInlineConfig: true;
20
22
  readonly reportUnusedDisableDirectives: "error";
@@ -1 +1 @@
1
- {"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../src/factory/options/option/Option.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,MAAM,CAClC,CAAC,SAAS,KAAK,EACf,QAAQ,SAAS,MAAM,EACvB,MAAM,SAAS,OAAO,GAAG,IAAI,EAC7B,aAAa,SAAS,MAAM,GAAG,OAAO,GAAG,KAAK,EAC9C,WAAW,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EACjC,WAAW,SAAS,MAAM,GAAG,KAAK,EAClC,SAAS,SAAS,MAAM,GAAG,KAAK;aAWd,KAAK,EAAE,SAAS,MAAM,EAAE;aACxB,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC;aAC5B,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC;IAXrD,SAAgB,aAAa;;;MAGlB;IAEX,kBAAyB,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACxD,kB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aAAa;;;MAGlB;IAEX,kBAAyB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9C,kBAAyB,SAAS,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,SAAS;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC;gBAGvJ,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,EAC5B,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC;IAGrD,IAAW,OAAO,IAAI,OAAO,EAAE,CA+B9B;IAED,IAAW,MAAM;;;;;;;;mBA1C8G,MAAM;uCA8DpI;IAED,aAAoB,eAAe,IAAI,UAAU,CAC/C,MAAM,EACN,aAAa,EACb,WAAW,CACZ,CAAC;CACH"}
@@ -1,21 +1,40 @@
1
1
  export default class Option {
2
2
  files;
3
+ ruleset;
3
4
  plugins;
4
5
  parser;
5
6
  linterOptions = {
6
7
  noInlineConfig: true,
7
8
  reportUnusedDisableDirectives: "error",
8
9
  };
9
- constructor(files, plugins, parser) {
10
+ constructor(files, ruleset, plugins, parser) {
10
11
  this.files = files;
12
+ this.ruleset = ruleset;
11
13
  this.plugins = plugins;
12
14
  this.parser = parser;
13
15
  }
16
+ get configs() {
17
+ const { scope, ruleset, files, option, } = this;
18
+ if (ruleset.id !== scope)
19
+ throw new TypeError(`Option and Ruleset scope mismatch`, { cause: { option: scope, ruleset: ruleset.id } });
20
+ else if (files.length < 1)
21
+ return [];
22
+ else {
23
+ const baseName = `scope:${scope}/rule:${ruleset.id}`;
24
+ return ruleset.records.map(([ruleId, rules]) => {
25
+ const name = `${baseName}+${ruleId}`;
26
+ return {
27
+ name,
28
+ files,
29
+ rules,
30
+ ...option,
31
+ };
32
+ });
33
+ }
34
+ }
14
35
  get option() {
15
- const { name, files, plugins, linterOptions, languageOptions, processor, } = this;
36
+ const { plugins, linterOptions, languageOptions, processor, } = this;
16
37
  return {
17
- name,
18
- files,
19
38
  linterOptions,
20
39
  languageOptions,
21
40
  plugins,
@@ -1 +1 @@
1
- {"version":3,"file":"Option.js","sourceRoot":"","sources":["../../../../src/factory/options/option/Option.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAgB,MAAM;IAkBhB;IACA;IACA;IAXF,aAAa,GAAG;QAC9B,cAAc,EAAE,IAAI;QACpB,6BAA6B,EAAE,OAAO;KAC9B,CAAC;IAKX,YACkB,KAAwB,EACxB,OAA4B,EAC5B,MAAmC;QAFnC,UAAK,GAAL,KAAK,CAAmB;QACxB,YAAO,GAAP,OAAO,CAAqB;QAC5B,WAAM,GAAN,MAAM,CAA6B;IAClD,CAAC;IAEJ,IAAW,MAAM;QACf,MAAM,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,aAAa,EACb,eAAe,EACf,SAAS,GACV,GAAG,IAAI,CAAC;QAET,OAAO;YACL,IAAI;YACJ,KAAK;YACL,aAAa;YACb,eAAe;YACf,OAAO;YACP,GAAG,SAAS;SAQb,CAAC;IACJ,CAAC;CAOF"}
1
+ {"version":3,"file":"Option.js","sourceRoot":"","sources":["../../../../src/factory/options/option/Option.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAgB,MAAM;IAkBhB;IACA;IACA;IACA;IAZF,aAAa,GAAG;QAC9B,cAAc,EAAE,IAAI;QACpB,6BAA6B,EAAE,OAAO;KAC9B,CAAC;IAKX,YACkB,KAAwB,EACxB,OAAmB,EACnB,OAA4B,EAC5B,MAAmC;QAHnC,UAAK,GAAL,KAAK,CAAmB;QACxB,YAAO,GAAP,OAAO,CAAY;QACnB,YAAO,GAAP,OAAO,CAAqB;QAC5B,WAAM,GAAN,MAAM,CAA6B;IAClD,CAAC;IAEJ,IAAW,OAAO;QAChB,MAAM,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EACL,MAAM,GACP,GAAG,IAAI,CAAC;QAET,IAAI,OAAO,CAAC,EAAE,KAAK,KAAK;YACtB,MAAM,IAAI,SAAS,CACjB,mCAAmC,EACnC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,CAClD,CAAC;aACC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YACvB,OAAO,EAAE,CAAC;aACP,CAAC;YACJ,MAAM,QAAQ,GAAG,SAAS,KAAK,SAAS,OAAO,CAAC,EAAE,EAAW,CAAC;YAE9D,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CACxB,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE;gBAClB,MAAM,IAAI,GAAG,GAAG,QAAQ,IAAI,MAAM,EAAW,CAAC;gBAE9C,OAAO;oBACL,IAAI;oBACJ,KAAK;oBACL,KAAK;oBACL,GAAG,MAAM;iBACV,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAW,MAAM;QACf,MAAM,EACJ,OAAO,EACP,aAAa,EACb,eAAe,EACf,SAAS,GACV,GAAG,IAAI,CAAC;QAET,OAAO;YACL,aAAa;YACb,eAAe;YACf,OAAO;YACP,GAAG,SAAS;SAOb,CAAC;IACJ,CAAC;CAOF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class HtmlOption extends Option<"html", "@html-eslint", false, true, 1> {
3
- readonly name = "scope:html";
3
+ readonly scope = "html";
4
4
  readonly processor: {};
5
5
  get languageOptions(): {
6
6
  readonly parser: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/html/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,cAAc,EACd,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,IAAI,gBAAgB;IACpC,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/html/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,cAAc,EACd,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,KAAK,UAAU;IAC/B,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class HtmlOption extends Option {
3
- name = "scope:html";
3
+ scope = "html";
4
4
  processor = {};
5
5
  get languageOptions() {
6
6
  const [parser] = this.parser;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/html/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAMvC;IACiB,IAAI,GAAG,YAAY,CAAC;IACpB,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/html/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAMvC;IACiB,KAAK,GAAG,MAAM,CAAC;IACf,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class JsOption extends Option<"js", "@stylistic"> {
3
- readonly name = "scope:js";
3
+ readonly scope = "js";
4
4
  readonly processor: {};
5
5
  get languageOptions(): {
6
6
  readonly ecmaVersion: "latest";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/js/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IAC9D,SAAgB,IAAI,cAAc;IAClC,SAAgB,SAAS,KAAM;IAE/B,IAAW,eAAe;;;MAKzB;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/js/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC;IAC9D,SAAgB,KAAK,QAAQ;IAC7B,SAAgB,SAAS,KAAM;IAE/B,IAAW,eAAe;;;MAKzB;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class JsOption extends Option {
3
- name = "scope:js";
3
+ scope = "js";
4
4
  processor = {};
5
5
  get languageOptions() {
6
6
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/js/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAA0B;IAC9C,IAAI,GAAG,UAAU,CAAC;IAClB,SAAS,GAAG,EAAE,CAAC;IAE/B,IAAW,eAAe;QACxB,OAAO;YACL,WAAW,EAAE,QAAQ;YACrB,UAAU,EAAE,QAAQ;SACZ,CAAC;IACb,CAAC;CACF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/js/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAA0B;IAC9C,KAAK,GAAG,IAAI,CAAC;IACb,SAAS,GAAG,EAAE,CAAC;IAE/B,IAAW,eAAe;QACxB,OAAO;YACL,WAAW,EAAE,QAAQ;YACrB,UAAU,EAAE,QAAQ;SACZ,CAAC;IACb,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class JsonOption extends Option<"json", "jsonc", false, true, 1> {
3
- readonly name = "scope:json";
3
+ readonly scope = "json";
4
4
  readonly processor: {};
5
5
  get languageOptions(): {
6
6
  readonly parser: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,IAAI,gBAAgB;IACpC,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,KAAK,UAAU;IAC/B,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class JsonOption extends Option {
3
- name = "scope:json";
3
+ scope = "json";
4
4
  processor = {};
5
5
  get languageOptions() {
6
6
  const [parser] = this.parser;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAMvC;IACiB,IAAI,GAAG,YAAY,CAAC;IACpB,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAMvC;IACiB,KAAK,GAAG,MAAM,CAAC;IACf,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class JsoncOption extends Option<"jsonc", "jsonc", false, true, 1> {
3
- readonly name = "scope:jsonc";
3
+ readonly scope = "jsonc";
4
4
  readonly processor: {};
5
5
  get languageOptions(): {
6
6
  readonly parser: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/jsonc/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM,CAC7C,OAAO,EACP,OAAO,EACP,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,IAAI,iBAAiB;IACrC,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/jsonc/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM,CAC7C,OAAO,EACP,OAAO,EACP,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,KAAK,WAAW;IAChC,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class JsoncOption extends Option {
3
- name = "scope:jsonc";
3
+ scope = "jsonc";
4
4
  processor = {};
5
5
  get languageOptions() {
6
6
  const [parser] = this.parser;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/jsonc/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAMxC;IACiB,IAAI,GAAG,aAAa,CAAC;IACrB,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/jsonc/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAMxC;IACiB,KAAK,GAAG,OAAO,CAAC;IAChB,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
@@ -7,7 +7,7 @@ export default class SvelteOption extends Option<"svelte", "svelte" | keyof TsOp
7
7
  }, 2, never, {
8
8
  processor: "svelte/svelte";
9
9
  }> {
10
- readonly name = "scope:svelte";
10
+ readonly scope = "svelte";
11
11
  readonly processor: {
12
12
  readonly processor: "svelte/svelte";
13
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/svelte/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAAM,CAC9C,QAAQ,EACR,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAC9C,IAAI,EACF,QAAQ,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,eAAe,CAAC,GACtD;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,mBAAmB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,EAC/C,CAAC,EACD,KAAK,EACL;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,CAC/B;IACC,SAAgB,IAAI,kBAAkB;IACtC,SAAgB,SAAS;;MAA2C;IAEpE,IAAW,eAAe;;;;;;;;;;;MAezB;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/svelte/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAAM,CAC9C,QAAQ,EACR,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAC9C,IAAI,EACF,QAAQ,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,eAAe,CAAC,GACtD;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,mBAAmB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,EAC/C,CAAC,EACD,KAAK,EACL;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,CAC/B;IACC,SAAgB,KAAK,YAAY;IACjC,SAAgB,SAAS;;MAA2C;IAEpE,IAAW,eAAe;;;;;;;;;;;MAezB;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class SvelteOption extends Option {
3
- name = "scope:svelte";
3
+ scope = "svelte";
4
4
  processor = { processor: "svelte/svelte" };
5
5
  get languageOptions() {
6
6
  const [parser, tsParser] = this.parser;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/svelte/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAUzC;IACiB,IAAI,GAAG,cAAc,CAAC;IACtB,SAAS,GAAG,EAAE,SAAS,EAAE,eAAe,EAAW,CAAC;IAEpE,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAEvC,OAAO;YACL,WAAW,EAAE,QAAQ;YACrB,UAAU,EAAE,QAAQ;YACpB,MAAM;YACN,aAAa,EAAE;gBACb,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,eAAe;gBACxB,mBAAmB,EAAE,CAAC,SAAS,CAAU;gBACzC,MAAM,EAAE,QAAQ;aACjB;SACO,CAAC;IACb,CAAC;CACF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/svelte/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAUzC;IACiB,KAAK,GAAG,QAAQ,CAAC;IACjB,SAAS,GAAG,EAAE,SAAS,EAAE,eAAe,EAAW,CAAC;IAEpE,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAEvC,OAAO;YACL,WAAW,EAAE,QAAQ;YACrB,UAAU,EAAE,QAAQ;YACpB,MAAM;YACN,aAAa,EAAE;gBACb,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,eAAe;gBACxB,mBAAmB,EAAE,CAAC,SAAS,CAAU;gBACzC,MAAM,EAAE,QAAQ;aACjB;SACO,CAAC;IACb,CAAC;CACF"}
@@ -3,7 +3,7 @@ import type JsOption from "../js/index.js";
3
3
  export default class TsOption extends Option<"ts", "@typescript-eslint" | keyof JsOption["option"]["plugins"], true, JsOption["option"]["languageOptions"] & {
4
4
  project: "tsconfig.json";
5
5
  }, 1> {
6
- readonly name = "scope:ts";
6
+ readonly scope = "ts";
7
7
  readonly processor: {};
8
8
  get languageOptions(): {
9
9
  readonly ecmaVersion: "latest";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EACJ,oBAAoB,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAC1D,IAAI,EACF,QAAQ,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,GACrC;IAAE,OAAO,EAAE,eAAe,CAAA;CAAE,EAC9B,CAAC,CACF;IACC,SAAgB,IAAI,cAAc;IAClC,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;;;;;;;;MAazB;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/factory/options/option/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EACJ,oBAAoB,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAC1D,IAAI,EACF,QAAQ,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,GACrC;IAAE,OAAO,EAAE,eAAe,CAAA;CAAE,EAC9B,CAAC,CACF;IACC,SAAgB,KAAK,QAAQ;IAC7B,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;;;;;;;;MAazB;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class TsOption extends Option {
3
- name = "scope:ts";
3
+ scope = "ts";
4
4
  processor = {};
5
5
  get languageOptions() {
6
6
  const [parser] = this.parser;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAOrC;IACiB,IAAI,GAAG,UAAU,CAAC;IAClB,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO;YACL,WAAW,EAAE,QAAQ;YACrB,UAAU,EAAE,QAAQ;YACpB,MAAM;YACN,aAAa,EAAE;gBACb,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,eAAe;aACzB;SACO,CAAC;IACb,CAAC;CACF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/factory/options/option/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAOrC;IACiB,KAAK,GAAG,IAAI,CAAC;IACb,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO;YACL,WAAW,EAAE,QAAQ;YACrB,UAAU,EAAE,QAAQ;YACpB,MAAM;YACN,aAAa,EAAE;gBACb,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,eAAe;aACzB;SACO,CAAC;IACb,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class YmlOption extends Option<"yml", "yml", false, true, 1> {
3
- readonly name = "scope:yml";
3
+ readonly scope = "yml";
4
4
  readonly processor: {};
5
5
  get languageOptions(): {
6
6
  readonly parser: unknown;
@@ -1 +1 @@
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,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,IAAI,eAAe;IACnC,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
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,KAAK,EACL,IAAI,EACJ,CAAC,CACF;IACC,SAAgB,KAAK,SAAS;IAC9B,SAAgB,SAAS,KAAe;IAExC,IAAW,eAAe;;MAIzB;CACF"}
@@ -1,6 +1,6 @@
1
1
  import Option from "../Option.js";
2
2
  export default class YmlOption extends Option {
3
- name = "scope:yml";
3
+ scope = "yml";
4
4
  processor = {};
5
5
  get languageOptions() {
6
6
  const [parser] = this.parser;
@@ -1 +1 @@
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,MAMtC;IACiB,IAAI,GAAG,WAAW,CAAC;IACnB,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,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,MAMtC;IACiB,KAAK,GAAG,KAAK,CAAC;IACd,SAAS,GAAG,EAAW,CAAC;IAExC,IAAW,eAAe;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,EAAE,MAAM,EAAW,CAAC;IAC7B,CAAC;CACF"}
@@ -1,12 +1,13 @@
1
1
  import Rule from "./rule/Rule.js";
2
+ import type { Scope } from "../Factory.js";
2
3
  export { Rule };
3
- export default class Ruleset<Language extends string> {
4
- readonly language: literalful<Language>;
4
+ export default class Ruleset<S extends Scope> {
5
+ private readonly scope;
5
6
  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;
7
+ overrides: Null<Rule>;
8
+ constructor(scope: literalful<S>, ...ruleset: readonly Rule[]);
9
+ get id(): literalful<S>;
10
+ get records(): (readonly [string, IRule])[];
11
+ override(overrides: undefined | IRule): this;
11
12
  }
12
13
  //# sourceMappingURL=Ruleset.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"Ruleset.d.ts","sourceRoot":"","sources":["../../../src/factory/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,CAAC,SAAS,KAAK;IAKxC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,SAAgB,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAQ;gBAGjB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACrC,GAAG,OAAO,EAAE,SAAS,IAAI,EAAE;IAK7B,IAAW,EAAE,kBAIZ;IAED,IAAW,OAAO,iCAOjB;IAEM,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,KAAK;CAS7C"}
@@ -1,26 +1,27 @@
1
1
  import Rule from "./rule/Rule.js";
2
2
  export { Rule };
3
3
  export default class Ruleset {
4
- language;
4
+ scope;
5
5
  ruleset;
6
- overrides = [];
7
- constructor(language, ...ruleset) {
8
- this.language = language;
6
+ overrides = null;
7
+ constructor(scope, ...ruleset) {
8
+ this.scope = scope;
9
9
  this.ruleset = [...ruleset];
10
10
  }
11
11
  get id() {
12
- return `ruleset:${this.language}`;
12
+ const { scope } = this;
13
+ return scope;
13
14
  }
14
- get flat() {
15
+ get records() {
16
+ const { ruleset, overrides } = this;
15
17
  return [
16
- ...this.ruleset.map(rules => rules.rules),
17
- ...this.overrides.map(rules => rules.rules),
18
+ ...ruleset.map(rules => [rules.id, rules.rules]),
19
+ ...overrides === null ? [] : [[overrides.id, overrides.rules]],
18
20
  ];
19
21
  }
20
- override(...overrides) {
21
- this.overrides.push(...overrides
22
- .filter(override => typeof override !== "undefined")
23
- .map(override => new Rule("override", override)));
22
+ override(overrides) {
23
+ if (typeof overrides !== "undefined")
24
+ this.overrides = new Rule("override", overrides);
24
25
  return this;
25
26
  }
26
27
  }
@@ -1 +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,OAA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ED,IAAW,EAAE;QACX,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAW,OAAO;QAChB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAEpC,OAAO;YACL,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAU,CAAC;YACzD,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,KAAK,CAAU,CAAU;SACjF,CAAC;IACJ,CAAC;IAEM,QAAQ,CAAC,SAA4B;QAC1C,IAAI,OAAO,SAAS,KAAK,WAAW;YAClC,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CACvB,UAAU,EACV,SAAS,CACV,CAAC;QAEJ,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { Scope, Plugins, Parsers, Config } from "./boundary/boundary.js";
1
+ import type { Scope, Plugins, Parsers, IConfig } from "./boundary/boundary.js";
2
2
  import { Ruleset, Rule } from "./factory/Factory.js";
3
3
  export type { Scope };
4
4
  export { Ruleset, Rule };
5
5
  export default function (plugins: Plugins, parsers: Parsers, base: Record<Scope, string[]>, includes: Particord<Scope, string[]>, rulesets: {
6
6
  [S in Scope]: Ruleset<S>;
7
- }, overrides: Particord<Scope, IRule>): Config[];
7
+ }, overrides: Particord<Scope, IRule>): IConfig[];
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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,CAgGV"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,EACR,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,OAAO,EAAE,CA0FX"}
package/dist/index.js CHANGED
@@ -19,38 +19,29 @@ export default function (plugins, parsers, base, includes, rulesets, overrides)
19
19
  rulesets[scope].override(overrides[scope]);
20
20
  const options = {
21
21
  js: new Options
22
- .js(files.files("js"), ...imports.js)
23
- .option,
22
+ .js(files.files("js"), rulesets.js, ...imports.js)
23
+ .configs,
24
24
  ts: new Options
25
- .ts(files.files("ts"), ...imports.ts)
26
- .option,
25
+ .ts(files.files("ts"), rulesets.ts, ...imports.ts)
26
+ .configs,
27
27
  svelte: new Options
28
- .svelte(files.files("svelte"), ...imports.svelte)
29
- .option,
28
+ .svelte(files.files("svelte"), rulesets.svelte, ...imports.svelte)
29
+ .configs,
30
30
  html: new Options
31
- .html(files.files("html"), ...imports.html)
32
- .option,
31
+ .html(files.files("html"), rulesets.html, ...imports.html)
32
+ .configs,
33
33
  json: new Options
34
- .json(files.files("json"), ...imports.json)
35
- .option,
34
+ .json(files.files("json"), rulesets.json, ...imports.json)
35
+ .configs,
36
36
  jsonc: new Options
37
- .jsonc(files.files("jsonc"), ...imports.jsonc)
38
- .option,
37
+ .jsonc(files.files("jsonc"), rulesets.jsonc, ...imports.jsonc)
38
+ .configs,
39
39
  yml: new Options
40
- .yml(files.files("yml"), ...imports.yml)
41
- .option,
40
+ .yml(files.files("yml"), rulesets.yml, ...imports.yml)
41
+ .configs,
42
42
  };
43
43
  return scopes
44
- .map(scope => options[scope].files.length > 0
45
- ? rulesets[scope]
46
- .flat
47
- .map(rules => {
48
- return {
49
- rules,
50
- ...options[scope],
51
- };
52
- })
53
- : [])
44
+ .map(scope => options[scope])
54
45
  .flat();
55
46
  }
56
47
  catch (e) {
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,wBAAwB,CAAC;AAO5C,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,OAAgB,EACh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"name": "@eslinted/core",
3
- "version": "0.8.0-rc.0",
3
+ "version": "0.8.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -1,11 +1,11 @@
1
1
  import scopes, { type Scope } from "./scopes/scopes.js";
2
2
  import type { Plugins, Parsers } from "./input/input.js";
3
- import type Config from "./output/output.js";
3
+ import type IConfig from "./output/output.js";
4
4
 
5
5
  export default scopes;
6
6
  export type {
7
7
  Scope,
8
8
  Plugins,
9
9
  Parsers,
10
- Config,
10
+ IConfig,
11
11
  };
@@ -1,7 +1,7 @@
1
1
  import type { Scope, Options } from "../../../factory/Factory.js";
2
2
 
3
3
  type Plugins = {
4
- [S in Scope]: InstanceType<typeof Options[S]>["plugins"];
4
+ readonly [S in Scope]: InstanceType<typeof Options[S]>["plugins"];
5
5
  };
6
6
 
7
7
  export type { Plugins as default };
@@ -1,5 +1,5 @@
1
1
  export default interface IConfig {
2
- name: `scope:${string}`;
2
+ name: `scope:${string}/rule:${string}+${string}`;
3
3
  rules: IRule;
4
4
  files: readonly string[];
5
5
  linterOptions: {
@@ -1,5 +1,4 @@
1
1
  declare type IOption<
2
- Name extends string,
3
2
  PluginId extends string,
4
3
  IsEcma extends boolean,
5
4
  ParserOptions extends object | boolean,
@@ -7,8 +6,6 @@ declare type IOption<
7
6
  Processor extends object,
8
7
  > =
9
8
  {
10
- name: IOName<Name>;
11
- files: readonly string[];
12
9
  linterOptions: IOLinter;
13
10
  languageOptions: IOLanguage<
14
11
  IsEcma,
@@ -1,4 +1,6 @@
1
1
  import type { Scope } from "../Options.js";
2
+ import type { Ruleset } from "../../Factory.js";
3
+ import type { IConfig } from "../../../boundary/boundary.js";
2
4
 
3
5
  export default abstract class Option<
4
6
  S extends Scope,
@@ -14,19 +16,51 @@ export default abstract class Option<
14
16
  reportUnusedDisableDirectives: "error",
15
17
  } as const;
16
18
 
17
- public abstract readonly name: literalful<`scope:${S}`>;
19
+ public abstract readonly scope: literalful<S>;
18
20
  public abstract readonly processor: (Interface<Processor> extends never ? object : Interface<Processor> extends { "interface": string } ? Interface<Processor> : object);
19
21
 
20
22
  constructor(
21
23
  public readonly files: readonly string[],
24
+ public readonly ruleset: Ruleset<S>,
22
25
  public readonly plugins: IOPlugins<PluginId>,
23
26
  public readonly parser: Tuple<unknown, ParserCount>,
24
27
  ) {}
25
28
 
26
- public get option() {
29
+ public get configs(): IConfig[] {
27
30
  const {
28
- name,
31
+ scope,
32
+ ruleset,
29
33
  files,
34
+ option,
35
+ } = this;
36
+
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;
46
+
47
+ return ruleset.records.map(
48
+ ([ruleId, rules]) => {
49
+ const name = `${baseName}+${ruleId}` as const;
50
+
51
+ return {
52
+ name,
53
+ files,
54
+ rules,
55
+ ...option,
56
+ };
57
+ },
58
+ );
59
+ }
60
+ }
61
+
62
+ public get option() {
63
+ const {
30
64
  plugins,
31
65
  linterOptions,
32
66
  languageOptions,
@@ -34,14 +68,11 @@ export default abstract class Option<
34
68
  } = this;
35
69
 
36
70
  return {
37
- name,
38
- files,
39
71
  linterOptions,
40
72
  languageOptions,
41
73
  plugins,
42
74
  ...processor,
43
75
  } satisfies IOption<
44
- `scope:${S}`,
45
76
  PluginId,
46
77
  IsEcma,
47
78
  ParserOptions,
@@ -7,7 +7,7 @@ export default class HtmlOption extends Option<
7
7
  true,
8
8
  1
9
9
  > {
10
- public readonly name = "scope:html";
10
+ public readonly scope = "html";
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
@@ -1,7 +1,7 @@
1
1
  import Option from "../Option.js";
2
2
 
3
3
  export default class JsOption extends Option<"js", "@stylistic"> {
4
- public readonly name = "scope:js";
4
+ public readonly scope = "js";
5
5
  public readonly processor = {};
6
6
 
7
7
  public get languageOptions() {
@@ -7,7 +7,7 @@ export default class JsonOption extends Option<
7
7
  true,
8
8
  1
9
9
  > {
10
- public readonly name = "scope:json";
10
+ public readonly scope = "json";
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
@@ -7,7 +7,7 @@ export default class JsoncOption extends Option<
7
7
  true,
8
8
  1
9
9
  > {
10
- public readonly name = "scope:jsonc";
10
+ public readonly scope = "jsonc";
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
@@ -12,7 +12,7 @@ export default class SvelteOption extends Option<
12
12
  never,
13
13
  { processor: "svelte/svelte" }
14
14
  > {
15
- public readonly name = "scope:svelte";
15
+ public readonly scope = "svelte";
16
16
  public readonly processor = { processor: "svelte/svelte" } as const;
17
17
 
18
18
  public get languageOptions() {
@@ -9,7 +9,7 @@ export default class TsOption extends Option<
9
9
  & { project: "tsconfig.json" },
10
10
  1
11
11
  > {
12
- public readonly name = "scope:ts";
12
+ public readonly scope = "ts";
13
13
  public readonly processor = {} as const;
14
14
 
15
15
  public get languageOptions() {
@@ -7,7 +7,7 @@ export default class YmlOption extends Option<
7
7
  true,
8
8
  1
9
9
  > {
10
- public readonly name = "scope:yml";
10
+ public readonly scope = "yml";
11
11
  public readonly processor = {} as const;
12
12
 
13
13
  public get languageOptions() {
@@ -1,39 +1,39 @@
1
1
  import Rule from "./rule/Rule.js";
2
+ import type { Scope } from "../Factory.js";
2
3
 
3
4
  export { Rule };
4
- export default class Ruleset<Language extends string> {
5
+ export default class Ruleset<S extends Scope> {
5
6
  public readonly ruleset: readonly Rule[];
6
- public readonly overrides: Rule[] = [];
7
+ public overrides: Null<Rule> = null;
7
8
 
8
9
  constructor(
9
- public readonly language: literalful<Language>,
10
+ private readonly scope: literalful<S>,
10
11
  ...ruleset: readonly Rule[]
11
12
  ) {
12
13
  this.ruleset = [...ruleset];
13
14
  }
14
15
 
15
16
  public get id() {
16
- return `ruleset:${this.language}` as const;
17
+ const { scope } = this;
18
+
19
+ return scope;
17
20
  }
18
21
 
19
- public get flat() {
22
+ public get records() {
23
+ const { ruleset, overrides } = this;
24
+
20
25
  return [
21
- ...this.ruleset.map(rules => rules.rules),
22
- ...this.overrides.map(rules => rules.rules),
26
+ ...ruleset.map(rules => [rules.id, rules.rules] as const),
27
+ ...overrides === null ? [] : [[overrides.id, overrides.rules] as const] as const,
23
28
  ];
24
29
  }
25
30
 
26
- public override(...overrides: (undefined | IRule)[]) {
27
- this.overrides.push(
28
- ...overrides
29
- .filter(override => typeof override !== "undefined")
30
- .map(
31
- override => new Rule(
32
- "override",
33
- override,
34
- ),
35
- ),
36
- );
31
+ public override(overrides: undefined | IRule) {
32
+ if (typeof overrides !== "undefined")
33
+ this.overrides = new Rule(
34
+ "override",
35
+ overrides,
36
+ );
37
37
 
38
38
  return this;
39
39
  }
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@ import type {
3
3
  Scope,
4
4
  Plugins,
5
5
  Parsers,
6
- Config,
6
+ IConfig,
7
7
  } from "./boundary/boundary.js";
8
8
  import {
9
9
  Options,
@@ -21,14 +21,14 @@ export default function (
21
21
  includes: Particord<Scope, string[]>,
22
22
  rulesets: { [S in Scope]: Ruleset<S> },
23
23
  overrides: Particord<Scope, IRule>,
24
- ): Config[] {
24
+ ): IConfig[] {
25
25
  try {
26
26
  const files = new Files(
27
27
  base,
28
28
  includes,
29
29
  ),
30
30
  imports: {
31
- [S in Scope]: OmitFirst<ConstructorParameters<typeof Options[S]>>;
31
+ [S in Scope]: OmitFilesRuleset<ConstructorParameters<typeof Options[S]>>;
32
32
  } = {
33
33
  js: [plugins.js, []] as const,
34
34
  ts: [plugins.ts, [parsers.ts]] as const,
@@ -48,67 +48,61 @@ export default function (
48
48
  const options: {
49
49
  [S in Scope]: InstanceType<
50
50
  typeof Options[S]
51
- >["option"]
51
+ >["configs"]
52
52
  } = {
53
53
  js: new Options
54
54
  .js(
55
55
  files.files("js"),
56
+ rulesets.js,
56
57
  ...imports.js,
57
58
  )
58
- .option,
59
+ .configs,
59
60
  ts: new Options
60
61
  .ts(
61
62
  files.files("ts"),
63
+ rulesets.ts,
62
64
  ...imports.ts,
63
65
  )
64
- .option,
66
+ .configs,
65
67
  svelte: new Options
66
68
  .svelte(
67
69
  files.files("svelte"),
70
+ rulesets.svelte,
68
71
  ...imports.svelte,
69
72
  )
70
- .option,
73
+ .configs,
71
74
  html: new Options
72
75
  .html(
73
76
  files.files("html"),
77
+ rulesets.html,
74
78
  ...imports.html,
75
79
  )
76
- .option,
80
+ .configs,
77
81
  json: new Options
78
82
  .json(
79
83
  files.files("json"),
84
+ rulesets.json,
80
85
  ...imports.json,
81
86
  )
82
- .option,
87
+ .configs,
83
88
  jsonc: new Options
84
89
  .jsonc(
85
90
  files.files("jsonc"),
91
+ rulesets.jsonc,
86
92
  ...imports.jsonc,
87
93
  )
88
- .option,
94
+ .configs,
89
95
  yml: new Options
90
96
  .yml(
91
97
  files.files("yml"),
98
+ rulesets.yml,
92
99
  ...imports.yml,
93
100
  )
94
- .option,
101
+ .configs,
95
102
  };
96
103
 
97
104
  return scopes
98
- .map(
99
- scope => options[scope].files.length > 0
100
- ? rulesets[scope]
101
- .flat
102
- .map(
103
- rules => {
104
- return {
105
- rules,
106
- ...options[scope],
107
- };
108
- },
109
- )
110
- : [],
111
- )
105
+ .map(scope => options[scope])
112
106
  .flat();
113
107
  }
114
108
  catch (e) {
@@ -0,0 +1 @@
1
+ declare type OmitFilesRuleset<A> = A extends readonly [unknown, unknown, ...infer An_1] ? An_1 : never;
@@ -1 +0,0 @@
1
- declare type IOName<Name extends string> = literalful<Name>;
@@ -1 +0,0 @@
1
- declare type OmitFirst<A> = A extends readonly [unknown, ...infer An_1] ? An_1 : never;