@eslinted/core 0.0.1-rc.1 → 0.0.1-rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. package/dist/index.d.ts +6 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +65 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/options/HtmlOption.d.ts +5 -0
  6. package/dist/options/HtmlOption.d.ts.map +1 -0
  7. package/dist/options/HtmlOption.js +16 -0
  8. package/dist/options/HtmlOption.js.map +1 -0
  9. package/dist/options/JsOption.d.ts +5 -0
  10. package/dist/options/JsOption.d.ts.map +1 -0
  11. package/dist/options/JsOption.js +19 -0
  12. package/dist/options/JsOption.js.map +1 -0
  13. package/dist/options/JsonOption.d.ts +5 -0
  14. package/dist/options/JsonOption.d.ts.map +1 -0
  15. package/dist/options/JsonOption.js +16 -0
  16. package/dist/options/JsonOption.js.map +1 -0
  17. package/dist/options/JsoncOption.d.ts +5 -0
  18. package/dist/options/JsoncOption.d.ts.map +1 -0
  19. package/dist/options/JsoncOption.js +16 -0
  20. package/dist/options/JsoncOption.js.map +1 -0
  21. package/dist/options/MdOption.d.ts +5 -0
  22. package/dist/options/MdOption.d.ts.map +1 -0
  23. package/dist/options/MdOption.js +16 -0
  24. package/dist/options/MdOption.js.map +1 -0
  25. package/dist/options/SvelteOption.d.ts +10 -0
  26. package/dist/options/SvelteOption.d.ts.map +1 -0
  27. package/dist/options/SvelteOption.js +28 -0
  28. package/dist/options/SvelteOption.js.map +1 -0
  29. package/dist/options/TsOption.d.ts +8 -0
  30. package/dist/options/TsOption.d.ts.map +1 -0
  31. package/dist/options/TsOption.js +25 -0
  32. package/dist/options/TsOption.js.map +1 -0
  33. package/dist/options/YmlOption.d.ts +5 -0
  34. package/dist/options/YmlOption.d.ts.map +1 -0
  35. package/dist/options/YmlOption.js +16 -0
  36. package/dist/options/YmlOption.js.map +1 -0
  37. package/dist/options/option/Option.d.ts +5 -0
  38. package/dist/options/option/Option.d.ts.map +1 -0
  39. package/dist/options/option/Option.js +7 -0
  40. package/dist/options/option/Option.js.map +1 -0
  41. package/dist/options.d.ts +18 -0
  42. package/dist/options.d.ts.map +1 -0
  43. package/dist/options.js +17 -0
  44. package/dist/options.js.map +1 -0
  45. package/dist/rulesets/ruleset/Ruleset.d.ts +12 -0
  46. package/dist/rulesets/ruleset/Ruleset.d.ts.map +1 -0
  47. package/dist/rulesets/ruleset/Ruleset.js +27 -0
  48. package/dist/rulesets/ruleset/Ruleset.js.map +1 -0
  49. package/dist/rulesets/ruleset/rule/Rule.d.ts +6 -0
  50. package/dist/rulesets/ruleset/rule/Rule.d.ts.map +1 -0
  51. package/dist/rulesets/ruleset/rule/Rule.js +9 -0
  52. package/dist/rulesets/ruleset/rule/Rule.js.map +1 -0
  53. package/dist/scopes.d.ts +3 -0
  54. package/dist/scopes.d.ts.map +1 -0
  55. package/dist/scopes.js +11 -0
  56. package/dist/scopes.js.map +1 -0
  57. package/package.json +1 -1
  58. package/src/Scope.d.ts +9 -0
  59. package/src/index.ts +113 -0
  60. package/src/options/HtmlOption.ts +31 -0
  61. package/src/options/JsOption.ts +27 -0
  62. package/src/options/JsonOption.ts +31 -0
  63. package/src/options/JsoncOption.ts +31 -0
  64. package/src/options/MdOption.ts +31 -0
  65. package/src/options/SvelteOption.ts +47 -0
  66. package/src/options/TsOption.ts +40 -0
  67. package/src/options/YmlOption.ts +31 -0
  68. package/src/options/option/Option.ts +25 -0
  69. package/src/options.ts +17 -0
  70. package/src/plugins.d.ts +24 -0
  71. package/src/rulesets/ruleset/Ruleset.ts +50 -0
  72. package/src/rulesets/ruleset/rule/Rule.ts +6 -0
  73. package/src/scopes.ts +11 -0
package/dist/index.d.ts CHANGED
@@ -1 +1,7 @@
1
+ import type Ruleset from "./rulesets/ruleset/Ruleset.js";
2
+ export { default as Ruleset } from "./rulesets/ruleset/Ruleset.js";
3
+ export { Rule } from "./rulesets/ruleset/Ruleset.js";
4
+ export default function (plugins: Plugins, parsers: Record<Scope, unknown>, files: Record<Scope, string[]>, rulesets: {
5
+ [S in Scope]: Ruleset<S>;
6
+ }): IConfig[];
1
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,EAC/B,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAC9B,QAAQ,EAAE;KAAG,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC;CAAE,GACrC,OAAO,EAAE,CAqGX"}
package/dist/index.js CHANGED
@@ -1,2 +1,66 @@
1
- "use strict";
1
+ import scopes from "./scopes.js";
2
+ import options from "./options.js";
3
+ export { default as Ruleset } from "./rulesets/ruleset/Ruleset.js";
4
+ export { Rule } from "./rulesets/ruleset/Ruleset.js";
5
+ export default function (plugins, parsers, files, rulesets) {
6
+ try {
7
+ const instantiatedOptions = {
8
+ js: new options
9
+ .js(plugins
10
+ .js, ...files
11
+ .js)
12
+ .body,
13
+ ts: new options
14
+ .ts(plugins
15
+ .ts, parsers
16
+ .ts, ...files
17
+ .ts)
18
+ .body,
19
+ svelte: new options
20
+ .svelte(plugins
21
+ .svelte, parsers
22
+ .svelte, parsers
23
+ .ts, ...files
24
+ .svelte)
25
+ .body,
26
+ html: new options
27
+ .html(plugins
28
+ .html, parsers
29
+ .html, ...files
30
+ .html)
31
+ .body,
32
+ json: new options
33
+ .json(plugins
34
+ .json, parsers
35
+ .json, ...files
36
+ .json)
37
+ .body,
38
+ jsonc: new options
39
+ .jsonc(plugins
40
+ .jsonc, parsers
41
+ .jsonc, ...files
42
+ .jsonc)
43
+ .body,
44
+ yml: new options
45
+ .yml(plugins
46
+ .yml, parsers
47
+ .yml, ...files
48
+ .yml)
49
+ .body,
50
+ };
51
+ return scopes
52
+ .map(scope => instantiatedOptions[scope].files.length > 0
53
+ ? rulesets[scope].flat.map(rules => {
54
+ return {
55
+ rules,
56
+ ...instantiatedOptions[scope],
57
+ };
58
+ })
59
+ : [])
60
+ .flat();
61
+ }
62
+ catch (e) {
63
+ throw new Error(`linted(): Caught exception.`, { cause: e });
64
+ }
65
+ }
2
66
  //# 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":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AAGnC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,MAAM,CAAC,OAAO,WACZ,OAAgB,EAChB,OAA+B,EAC/B,KAA8B,EAC9B,QAAsC;IAEtC,IAAI,CAAC;QACH,MAAM,mBAAmB,GAIrB;YACF,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,OAAO;iBACJ,EAAE,EACL,GAAG,KAAK;iBACL,EAAE,CACN;iBACA,IAAI;YACP,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,OAAO;iBACJ,EAAE,EACL,OAAO;iBACJ,EAAE,EACL,GAAG,KAAK;iBACL,EAAE,CACN;iBACA,IAAI;YACP,MAAM,EAAE,IAAI,OAAO;iBAChB,MAAM,CACL,OAAO;iBACJ,MAAM,EACT,OAAO;iBACJ,MAAM,EACT,OAAO;iBACJ,EAAE,EACL,GAAG,KAAK;iBACL,MAAM,CACV;iBACA,IAAI;YACP,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,OAAO;iBACJ,IAAI,EACP,OAAO;iBACJ,IAAI,EACP,GAAG,KAAK;iBACL,IAAI,CACR;iBACA,IAAI;YACP,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,OAAO;iBACJ,IAAI,EACP,OAAO;iBACJ,IAAI,EACP,GAAG,KAAK;iBACL,IAAI,CACR;iBACA,IAAI;YACP,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,OAAO;iBACJ,KAAK,EACR,OAAO;iBACJ,KAAK,EACR,GAAG,KAAK;iBACL,KAAK,CACT;iBACA,IAAI;YACP,GAAG,EAAE,IAAI,OAAO;iBACb,GAAG,CACF,OAAO;iBACJ,GAAG,EACN,OAAO;iBACJ,GAAG,EACN,GAAG,KAAK;iBACL,GAAG,CACP;iBACA,IAAI;SACR,CAAC;QAEF,OAAO,MAAM;aACV,GAAG,CACF,KAAK,CAAC,EAAE,CACN,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YACzC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CACxB,KAAK,CAAC,EAAE;gBACN,OAAO;oBACL,KAAK;oBACL,GAAG,mBAAmB,CAAC,KAAK,CAAC;iBAC9B,CAAC;YACJ,CAAC,CACF;YACD,CAAC,CAAC,EAAE,CACT;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"}
@@ -0,0 +1,5 @@
1
+ import Option from "./option/Option.js";
2
+ export default class HtmlOption extends Option<"html", "@html-eslint", true, never, never, never, never, never> {
3
+ constructor(plugins: HtmlOption["body"]["plugins"], parser: HtmlOption["body"]["languageOptions"]["parser"], ...files: string[]);
4
+ }
5
+ //# sourceMappingURL=HtmlOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HtmlOption.d.ts","sourceRoot":"","sources":["../../src/options/HtmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,cAAc,EACd,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACtC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACvD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
@@ -0,0 +1,16 @@
1
+ import Option from "./option/Option.js";
2
+ export default class HtmlOption extends Option {
3
+ constructor(plugins, parser, ...files) {
4
+ super({
5
+ name: "linted/scope:html",
6
+ files,
7
+ plugins,
8
+ linterOptions: {
9
+ noInlineConfig: true,
10
+ reportUnusedDisableDirectives: "error",
11
+ },
12
+ languageOptions: { parser },
13
+ });
14
+ }
15
+ }
16
+ //# sourceMappingURL=HtmlOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HtmlOption.js","sourceRoot":"","sources":["../../src/options/HtmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MASvC;IACC,YACE,OAAsC,EACtC,MAAuD,EACvD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,mBAAmB;YACzB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;SAC5B,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import Option from "./option/Option.js";
2
+ export default class JsOption extends Option<"js", "@stylistic"> {
3
+ constructor(plugins: JsOption["body"]["plugins"], ...files: string[]);
4
+ }
5
+ //# sourceMappingURL=JsOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsOption.d.ts","sourceRoot":"","sources":["../../src/options/JsOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EACJ,YAAY,CACb;gBAEG,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACpC,GAAG,KAAK,EAAE,MAAM,EAAE;CAkBrB"}
@@ -0,0 +1,19 @@
1
+ import Option from "./option/Option.js";
2
+ export default class JsOption extends Option {
3
+ constructor(plugins, ...files) {
4
+ super({
5
+ name: "linted/scope:js",
6
+ files,
7
+ plugins,
8
+ linterOptions: {
9
+ noInlineConfig: true,
10
+ reportUnusedDisableDirectives: "error",
11
+ },
12
+ languageOptions: {
13
+ ecmaVersion: "latest",
14
+ sourceType: "module",
15
+ },
16
+ });
17
+ }
18
+ }
19
+ //# sourceMappingURL=JsOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsOption.js","sourceRoot":"","sources":["../../src/options/JsOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAGrC;IACC,YACE,OAAoC,EACpC,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,iBAAiB;YACvB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE;gBACf,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;aACrB;SACF,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import Option from "./option/Option.js";
2
+ export default class JsonOption extends Option<"json", "jsonc", true, never, never, never, never, never> {
3
+ constructor(plugins: JsonOption["body"]["plugins"], parser: JsonOption["body"]["languageOptions"]["parser"], ...files: string[]);
4
+ }
5
+ //# sourceMappingURL=JsonOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonOption.d.ts","sourceRoot":"","sources":["../../src/options/JsonOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MAAM,CAC5C,MAAM,EACN,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACtC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACvD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
@@ -0,0 +1,16 @@
1
+ import Option from "./option/Option.js";
2
+ export default class JsonOption extends Option {
3
+ constructor(plugins, parser, ...files) {
4
+ super({
5
+ name: "linted/scope:json",
6
+ files,
7
+ plugins,
8
+ linterOptions: {
9
+ noInlineConfig: true,
10
+ reportUnusedDisableDirectives: "error",
11
+ },
12
+ languageOptions: { parser },
13
+ });
14
+ }
15
+ }
16
+ //# sourceMappingURL=JsonOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonOption.js","sourceRoot":"","sources":["../../src/options/JsonOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,MASvC;IACC,YACE,OAAsC,EACtC,MAAuD,EACvD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,mBAAmB;YACzB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;SAC5B,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import Option from "./option/Option.js";
2
+ export default class JsoncOption extends Option<"jsonc", "jsonc", true, never, never, never, never, never> {
3
+ constructor(plugins: JsoncOption["body"]["plugins"], parser: JsoncOption["body"]["languageOptions"]["parser"], ...files: string[]);
4
+ }
5
+ //# sourceMappingURL=JsoncOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsoncOption.d.ts","sourceRoot":"","sources":["../../src/options/JsoncOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM,CAC7C,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACvC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACxD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
@@ -0,0 +1,16 @@
1
+ import Option from "./option/Option.js";
2
+ export default class JsoncOption extends Option {
3
+ constructor(plugins, parser, ...files) {
4
+ super({
5
+ name: "linted/scope:jsonc",
6
+ files,
7
+ plugins,
8
+ linterOptions: {
9
+ noInlineConfig: true,
10
+ reportUnusedDisableDirectives: "error",
11
+ },
12
+ languageOptions: { parser },
13
+ });
14
+ }
15
+ }
16
+ //# sourceMappingURL=JsoncOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsoncOption.js","sourceRoot":"","sources":["../../src/options/JsoncOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MASxC;IACC,YACE,OAAuC,EACvC,MAAwD,EACxD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,oBAAoB;YAC1B,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;SAC5B,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import Option from "./option/Option.js";
2
+ export default class MdOption extends Option<"md", "yml", true, never, never, never, never, never> {
3
+ constructor(plugins: MdOption["body"]["plugins"], parser: MdOption["body"]["languageOptions"]["parser"], ...files: string[]);
4
+ }
5
+ //# sourceMappingURL=MdOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MdOption.d.ts","sourceRoot":"","sources":["../../src/options/MdOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACpC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACrD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
@@ -0,0 +1,16 @@
1
+ import Option from "./option/Option.js";
2
+ export default class MdOption extends Option {
3
+ constructor(plugins, parser, ...files) {
4
+ super({
5
+ name: "linted/scope:md",
6
+ files,
7
+ plugins,
8
+ linterOptions: {
9
+ noInlineConfig: true,
10
+ reportUnusedDisableDirectives: "error",
11
+ },
12
+ languageOptions: { parser },
13
+ });
14
+ }
15
+ }
16
+ //# sourceMappingURL=MdOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MdOption.js","sourceRoot":"","sources":["../../src/options/MdOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MASrC;IACC,YACE,OAAoC,EACpC,MAAqD,EACrD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,iBAAiB;YACvB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;SAC5B,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ import Option from "./option/Option.js";
2
+ import type TsOption from "./TsOption.js";
3
+ export default class SvelteOption extends Option<"svelte", "svelte" | keyof TsOption["body"]["plugins"], true, TsOption["body"]["languageOptions"]["parserOptions"] & {
4
+ parser: unknown;
5
+ } & {
6
+ extraFileExtensions: [".svelte"];
7
+ }, never, "svelte/svelte"> {
8
+ constructor(plugins: SvelteOption["body"]["plugins"], svelteParser: SvelteOption["body"]["languageOptions"]["parser"], tsParser: SvelteOption["body"]["languageOptions"]["parserOptions"]["parser"], ...files: string[]);
9
+ }
10
+ //# sourceMappingURL=SvelteOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SvelteOption.d.ts","sourceRoot":"","sources":["../../src/options/SvelteOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAAM,CAC9C,QAAQ,EACN,QAAQ,GACR,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAEnC,IAAI,EACF,QAAQ,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,eAAe,CAAC,GACpD;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,mBAAmB,EAAE,CAAC,SAAS,CAAC,CAAA;CAAE,EACtC,KAAK,EACL,eAAe,CAChB;gBAEG,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACxC,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EAC/D,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,EAC5E,GAAG,KAAK,EAAE,MAAM,EAAE;CA2BrB"}
@@ -0,0 +1,28 @@
1
+ import Option from "./option/Option.js";
2
+ export default class SvelteOption extends Option {
3
+ constructor(plugins, svelteParser, tsParser, ...files) {
4
+ super({
5
+ name: "linted/scope:svelte",
6
+ processor: "svelte/svelte",
7
+ files,
8
+ plugins,
9
+ linterOptions: {
10
+ noInlineConfig: true,
11
+ reportUnusedDisableDirectives: "error",
12
+ },
13
+ languageOptions: {
14
+ ecmaVersion: "latest",
15
+ sourceType: "module",
16
+ parser: svelteParser,
17
+ parserOptions: {
18
+ ecmaVersion: "latest",
19
+ sourceType: "module",
20
+ project: "tsconfig.json",
21
+ extraFileExtensions: [".svelte"],
22
+ parser: tsParser,
23
+ },
24
+ },
25
+ });
26
+ }
27
+ }
28
+ //# sourceMappingURL=SvelteOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SvelteOption.js","sourceRoot":"","sources":["../../src/options/SvelteOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAGxC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAWzC;IACC,YACE,OAAwC,EACxC,YAA+D,EAC/D,QAA4E,EAC5E,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,qBAAqB;YAC3B,SAAS,EAAE,eAAe;YAC1B,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE;gBACf,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,MAAM,EAAE,YAAY;gBACpB,aAAa,EAAE;oBACb,WAAW,EAAE,QAAQ;oBACrB,UAAU,EAAE,QAAQ;oBACpB,OAAO,EAAE,eAAe;oBACxB,mBAAmB,EAAE,CAAC,SAAS,CAAC;oBAChC,MAAM,EAAE,QAAQ;iBACjB;aACF;SACF,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ import Option from "./option/Option.js";
2
+ import type JsOption from "./JsOption.js";
3
+ export default class TsOption extends Option<"ts", "@typescript-eslint" | keyof JsOption["body"]["plugins"], true, JsOption["body"]["languageOptions"] & {
4
+ project: "tsconfig.json";
5
+ }> {
6
+ constructor(plugins: TsOption["body"]["plugins"], parser: unknown, ...files: string[]);
7
+ }
8
+ //# sourceMappingURL=TsOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TsOption.d.ts","sourceRoot":"","sources":["../../src/options/TsOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EACF,oBAAoB,GACpB,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAEnC,IAAI,EACF,QAAQ,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,GACnC;IAAE,OAAO,EAAE,eAAe,CAAA;CAAE,CAC/B;gBAEG,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACpC,MAAM,EAAE,OAAO,EACf,GAAG,KAAK,EAAE,MAAM,EAAE;CAwBrB"}
@@ -0,0 +1,25 @@
1
+ import Option from "./option/Option.js";
2
+ export default class TsOption extends Option {
3
+ constructor(plugins, parser, ...files) {
4
+ super({
5
+ name: "linted/scope:ts",
6
+ files,
7
+ plugins,
8
+ linterOptions: {
9
+ noInlineConfig: true,
10
+ reportUnusedDisableDirectives: "error",
11
+ },
12
+ languageOptions: {
13
+ ecmaVersion: "latest",
14
+ sourceType: "module",
15
+ parser,
16
+ parserOptions: {
17
+ ecmaVersion: "latest",
18
+ sourceType: "module",
19
+ project: "tsconfig.json",
20
+ },
21
+ },
22
+ });
23
+ }
24
+ }
25
+ //# sourceMappingURL=TsOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TsOption.js","sourceRoot":"","sources":["../../src/options/TsOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAGxC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAQrC;IACC,YACE,OAAoC,EACpC,MAAe,EACf,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,iBAAiB;YACvB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE;gBACf,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,MAAM;gBACN,aAAa,EAAE;oBACb,WAAW,EAAE,QAAQ;oBACrB,UAAU,EAAE,QAAQ;oBACpB,OAAO,EAAE,eAAe;iBACzB;aACF;SACF,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import Option from "./option/Option.js";
2
+ export default class YmlOption extends Option<"yml", "yml", true, never, never, never, never, never> {
3
+ constructor(plugins: YmlOption["body"]["plugins"], parser: YmlOption["body"]["languageOptions"]["parser"], ...files: string[]);
4
+ }
5
+ //# sourceMappingURL=YmlOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YmlOption.d.ts","sourceRoot":"","sources":["../../src/options/YmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAAM,CAC3C,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,CACN;gBAEG,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACrC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACtD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
@@ -0,0 +1,16 @@
1
+ import Option from "./option/Option.js";
2
+ export default class YmlOption extends Option {
3
+ constructor(plugins, parser, ...files) {
4
+ super({
5
+ name: "linted/scope:yml",
6
+ files,
7
+ plugins,
8
+ linterOptions: {
9
+ noInlineConfig: true,
10
+ reportUnusedDisableDirectives: "error",
11
+ },
12
+ languageOptions: { parser },
13
+ });
14
+ }
15
+ }
16
+ //# sourceMappingURL=YmlOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YmlOption.js","sourceRoot":"","sources":["../../src/options/YmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAStC;IACC,YACE,OAAqC,EACrC,MAAsD,EACtD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,kBAAkB;YACxB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;SAC5B,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ export default class Option<Scope extends string, PluginId extends string, UseParser extends boolean = never, ParserOptions extends object = never, GlobalTypes extends string = never, ProcessorId extends string = never, Source extends IOLanguageSource.Source = "module", Ecma extends number | IOLanguageEcma.Ecma = "latest"> {
2
+ readonly body: IOption<`linted/scope:${literalful<Scope>}`, true, "error", PluginId, Ecma, Source, UseParser, ParserOptions, GlobalTypes, ProcessorId>;
3
+ constructor(body: IOption<`linted/scope:${literalful<Scope>}`, true, "error", PluginId, Ecma, Source, UseParser, ParserOptions, GlobalTypes, ProcessorId>);
4
+ }
5
+ //# sourceMappingURL=Option.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../src/options/option/Option.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,MAAM,CACzB,KAAK,SAAS,MAAM,EACpB,QAAQ,SAAS,MAAM,EACvB,SAAS,SAAS,OAAO,GAAG,KAAK,EACjC,aAAa,SAAS,MAAM,GAAG,KAAK,EACpC,WAAW,SAAS,MAAM,GAAG,KAAK,EAClC,WAAW,SAAS,MAAM,GAAG,KAAK,EAClC,MAAM,SAAS,gBAAgB,CAAC,MAAM,GAAG,QAAQ,EACjD,IAAI,SAAS,MAAM,GAAG,cAAc,CAAC,IAAI,GAAG,QAAQ;aAGlC,IAAI,EAAE,OAAO,CAC3B,gBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,EACnC,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,WAAW,CACZ;gBAXe,IAAI,EAAE,OAAO,CAC3B,gBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,EACnC,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,WAAW,CACZ;CAEJ"}
@@ -0,0 +1,7 @@
1
+ export default class Option {
2
+ body;
3
+ constructor(body) {
4
+ this.body = body;
5
+ }
6
+ }
7
+ //# sourceMappingURL=Option.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Option.js","sourceRoot":"","sources":["../../../src/options/option/Option.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,MAAM;IAWP;IADlB,YACkB,IAWf;QAXe,SAAI,GAAJ,IAAI,CAWnB;IACA,CAAC;CACL"}
@@ -0,0 +1,18 @@
1
+ import JsOption from "./options/JsOption.js";
2
+ import TsOption from "./options/TsOption.js";
3
+ import SvelteOption from "./options/SvelteOption.js";
4
+ import HtmlOption from "./options/HtmlOption.js";
5
+ import JsonOption from "./options/JsonOption.js";
6
+ import JsoncOption from "./options/JsoncOption.js";
7
+ import YmlOption from "./options/YmlOption.js";
8
+ declare const _default: {
9
+ js: typeof JsOption;
10
+ ts: typeof TsOption;
11
+ svelte: typeof SvelteOption;
12
+ html: typeof HtmlOption;
13
+ json: typeof JsonOption;
14
+ jsonc: typeof JsoncOption;
15
+ yml: typeof YmlOption;
16
+ };
17
+ export default _default;
18
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,SAAS,MAAM,wBAAwB,CAAC;;;;;;;;;;AAE/C,wBAQmC"}
@@ -0,0 +1,17 @@
1
+ import JsOption from "./options/JsOption.js";
2
+ import TsOption from "./options/TsOption.js";
3
+ import SvelteOption from "./options/SvelteOption.js";
4
+ import HtmlOption from "./options/HtmlOption.js";
5
+ import JsonOption from "./options/JsonOption.js";
6
+ import JsoncOption from "./options/JsoncOption.js";
7
+ import YmlOption from "./options/YmlOption.js";
8
+ export default {
9
+ js: JsOption,
10
+ ts: TsOption,
11
+ svelte: SvelteOption,
12
+ html: HtmlOption,
13
+ json: JsonOption,
14
+ jsonc: JsoncOption,
15
+ yml: YmlOption,
16
+ };
17
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C,eAAe;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,MAAM,EAAE,YAAY;IACpB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,WAAW;IAClB,GAAG,EAAE,SAAS;CACkB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import Rule from "./rule/Rule.js";
2
+ export { default as Rule } from "./rule/Rule.js";
3
+ export default class Ruleset<Language extends string> {
4
+ protected readonly language: literalful<Language>;
5
+ readonly ruleset: readonly Rule[];
6
+ readonly overrides: Rule[];
7
+ constructor(language: literalful<Language>, ...ruleset: readonly Rule[]);
8
+ get id(): `ruleset:${literalful<Language>}`;
9
+ get flat(): IRule[];
10
+ override(...overrides: (undefined | IRule)[]): this;
11
+ }
12
+ //# sourceMappingURL=Ruleset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Ruleset.d.ts","sourceRoot":"","sources":["../../../src/rulesets/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjD,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,QAAQ,SAAS,MAAM;IAKhD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IAJnD,SAAgB,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;IACzC,SAAgB,SAAS,EAAE,IAAI,EAAE,CAAM;gBAGlB,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,EACjD,GAAG,OAAO,EAAE,SAAS,IAAI,EAAE;IAK7B,IAAW,EAAE,sCAEZ;IAED,IAAW,IAAI,YAWd;IAEM,QAAQ,CAAC,GAAG,SAAS,EAAE,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE;CAkBpD"}
@@ -0,0 +1,27 @@
1
+ import Rule from "./rule/Rule.js";
2
+ export { default as Rule } from "./rule/Rule.js";
3
+ export default class Ruleset {
4
+ language;
5
+ ruleset;
6
+ overrides = [];
7
+ constructor(language, ...ruleset) {
8
+ this.language = language;
9
+ this.ruleset = [...ruleset];
10
+ }
11
+ get id() {
12
+ return `ruleset:${this.language}`;
13
+ }
14
+ get flat() {
15
+ return [
16
+ ...this.ruleset.map(rules => rules.rules),
17
+ ...this.overrides.map(rules => rules.rules),
18
+ ];
19
+ }
20
+ override(...overrides) {
21
+ this.overrides.push(...overrides
22
+ .filter(override => typeof override !== "undefined")
23
+ .map(override => new Rule("override", override)));
24
+ return this;
25
+ }
26
+ }
27
+ //# sourceMappingURL=Ruleset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Ruleset.js","sourceRoot":"","sources":["../../../src/rulesets/ruleset/Ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjD,MAAM,CAAC,OAAO,OAAO,OAAO;IAKL;IAJL,OAAO,CAAkB;IACzB,SAAS,GAAW,EAAE,CAAC;IAEvC,YACqB,QAA8B,EACjD,GAAG,OAAwB;QADR,aAAQ,GAAR,QAAQ,CAAsB;QAGjD,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,IAAW,EAAE;QACX,OAAO,WAAW,IAAI,CAAC,QAAQ,EAAW,CAAC;IAC7C,CAAC;IAED,IAAW,IAAI;QACb,OAAO;YACL,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CACjB,KAAK,CAAC,EAAE,CACN,KAAK,CAAC,KAAK,CACd;YACD,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CACnB,KAAK,CAAC,EAAE,CACN,KAAK,CAAC,KAAK,CACd;SACF,CAAC;IACJ,CAAC;IAEM,QAAQ,CAAC,GAAG,SAAgC;QACjD,IAAI,CAAC,SAAS,CAAC,IAAI,CACjB,GAAG,SAAS;aACT,MAAM,CACL,QAAQ,CAAC,EAAE,CACT,OAAO,QAAQ,KAAK,WAAW,CAClC;aACA,GAAG,CACF,QAAQ,CAAC,EAAE,CACT,IAAI,IAAI,CACN,UAAU,EACV,QAAQ,CACT,CACJ,CACJ,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ export default class Rule {
2
+ readonly id: string;
3
+ readonly rules: IRule;
4
+ constructor(id: string, rules: IRule);
5
+ }
6
+ //# sourceMappingURL=Rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../../../src/rulesets/ruleset/rule/Rule.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;aAEL,EAAE,EAAE,MAAM;aACV,KAAK,EAAE,KAAK;gBADZ,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,KAAK;CAE/B"}
@@ -0,0 +1,9 @@
1
+ export default class Rule {
2
+ id;
3
+ rules;
4
+ constructor(id, rules) {
5
+ this.id = id;
6
+ this.rules = rules;
7
+ }
8
+ }
9
+ //# sourceMappingURL=Rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rule.js","sourceRoot":"","sources":["../../../../src/rulesets/ruleset/rule/Rule.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;IAEL;IACA;IAFlB,YACkB,EAAU,EACV,KAAY;QADZ,OAAE,GAAF,EAAE,CAAQ;QACV,UAAK,GAAL,KAAK,CAAO;IAC3B,CAAC;CACL"}
@@ -0,0 +1,3 @@
1
+ declare const scopes: ["js", "ts", "svelte", "html", "json", "jsonc", "yml"];
2
+ export default scopes;
3
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM,wDAQgB,CAAC;AAE7B,eAAe,MAAM,CAAC"}
package/dist/scopes.js ADDED
@@ -0,0 +1,11 @@
1
+ const scopes = [
2
+ "js",
3
+ "ts",
4
+ "svelte",
5
+ "html",
6
+ "json",
7
+ "jsonc",
8
+ "yml",
9
+ ];
10
+ export default scopes;
11
+ //# sourceMappingURL=scopes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes.js","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACb,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;CACqB,CAAC;AAE7B,eAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslinted/core",
3
- "version": "0.0.1-rc.1",
3
+ "version": "0.0.1-rc.3",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
package/src/Scope.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ declare type Scope =
2
+ | "js"
3
+ | "ts"
4
+ | "svelte"
5
+ | "html"
6
+ | "json"
7
+ | "jsonc"
8
+ | "yml"
9
+ ;
package/src/index.ts CHANGED
@@ -0,0 +1,113 @@
1
+ import scopes from "./scopes.js";
2
+ import options from "./options.js";
3
+ import type Ruleset from "./rulesets/ruleset/Ruleset.js";
4
+
5
+ export { default as Ruleset } from "./rulesets/ruleset/Ruleset.js";
6
+ export { Rule } from "./rulesets/ruleset/Ruleset.js";
7
+ export default function (
8
+ plugins: Plugins,
9
+ parsers: Record<Scope, unknown>,
10
+ files: Record<Scope, string[]>,
11
+ rulesets: { [S in Scope]: Ruleset<S> },
12
+ ): IConfig[] {
13
+ try {
14
+ const instantiatedOptions: {
15
+ [S in Scope]: InstanceType<
16
+ typeof options[S]
17
+ >["body"]
18
+ } = {
19
+ js: new options
20
+ .js(
21
+ plugins
22
+ .js,
23
+ ...files
24
+ .js,
25
+ )
26
+ .body,
27
+ ts: new options
28
+ .ts(
29
+ plugins
30
+ .ts,
31
+ parsers
32
+ .ts,
33
+ ...files
34
+ .ts,
35
+ )
36
+ .body,
37
+ svelte: new options
38
+ .svelte(
39
+ plugins
40
+ .svelte,
41
+ parsers
42
+ .svelte,
43
+ parsers
44
+ .ts,
45
+ ...files
46
+ .svelte,
47
+ )
48
+ .body,
49
+ html: new options
50
+ .html(
51
+ plugins
52
+ .html,
53
+ parsers
54
+ .html,
55
+ ...files
56
+ .html,
57
+ )
58
+ .body,
59
+ json: new options
60
+ .json(
61
+ plugins
62
+ .json,
63
+ parsers
64
+ .json,
65
+ ...files
66
+ .json,
67
+ )
68
+ .body,
69
+ jsonc: new options
70
+ .jsonc(
71
+ plugins
72
+ .jsonc,
73
+ parsers
74
+ .jsonc,
75
+ ...files
76
+ .jsonc,
77
+ )
78
+ .body,
79
+ yml: new options
80
+ .yml(
81
+ plugins
82
+ .yml,
83
+ parsers
84
+ .yml,
85
+ ...files
86
+ .yml,
87
+ )
88
+ .body,
89
+ };
90
+
91
+ return scopes
92
+ .map(
93
+ scope =>
94
+ instantiatedOptions[scope].files.length > 0
95
+ ? rulesets[scope].flat.map(
96
+ rules => {
97
+ return {
98
+ rules,
99
+ ...instantiatedOptions[scope],
100
+ };
101
+ },
102
+ )
103
+ : [],
104
+ )
105
+ .flat();
106
+ }
107
+ catch (e) {
108
+ throw new Error(
109
+ `linted(): Caught exception.`,
110
+ { cause: e },
111
+ );
112
+ }
113
+ }
@@ -0,0 +1,31 @@
1
+ import Option from "./option/Option.js";
2
+
3
+ export default class HtmlOption extends Option<
4
+ "html",
5
+ "@html-eslint",
6
+ true,
7
+ never,
8
+ never,
9
+ never,
10
+ never,
11
+ never
12
+ > {
13
+ constructor(
14
+ plugins: HtmlOption["body"]["plugins"],
15
+ parser: HtmlOption["body"]["languageOptions"]["parser"],
16
+ ...files: string[]
17
+ ) {
18
+ super(
19
+ {
20
+ name: "linted/scope:html",
21
+ files,
22
+ plugins,
23
+ linterOptions: {
24
+ noInlineConfig: true,
25
+ reportUnusedDisableDirectives: "error",
26
+ },
27
+ languageOptions: { parser },
28
+ },
29
+ );
30
+ }
31
+ }
@@ -0,0 +1,27 @@
1
+ import Option from "./option/Option.js";
2
+
3
+ export default class JsOption extends Option<
4
+ "js",
5
+ "@stylistic"
6
+ > {
7
+ constructor(
8
+ plugins: JsOption["body"]["plugins"],
9
+ ...files: string[]
10
+ ) {
11
+ super(
12
+ {
13
+ name: "linted/scope:js",
14
+ files,
15
+ plugins,
16
+ linterOptions: {
17
+ noInlineConfig: true,
18
+ reportUnusedDisableDirectives: "error",
19
+ },
20
+ languageOptions: {
21
+ ecmaVersion: "latest",
22
+ sourceType: "module",
23
+ },
24
+ },
25
+ );
26
+ }
27
+ }
@@ -0,0 +1,31 @@
1
+ import Option from "./option/Option.js";
2
+
3
+ export default class JsonOption extends Option<
4
+ "json",
5
+ "jsonc",
6
+ true,
7
+ never,
8
+ never,
9
+ never,
10
+ never,
11
+ never
12
+ > {
13
+ constructor(
14
+ plugins: JsonOption["body"]["plugins"],
15
+ parser: JsonOption["body"]["languageOptions"]["parser"],
16
+ ...files: string[]
17
+ ) {
18
+ super(
19
+ {
20
+ name: "linted/scope:json",
21
+ files,
22
+ plugins,
23
+ linterOptions: {
24
+ noInlineConfig: true,
25
+ reportUnusedDisableDirectives: "error",
26
+ },
27
+ languageOptions: { parser },
28
+ },
29
+ );
30
+ }
31
+ }
@@ -0,0 +1,31 @@
1
+ import Option from "./option/Option.js";
2
+
3
+ export default class JsoncOption extends Option<
4
+ "jsonc",
5
+ "jsonc",
6
+ true,
7
+ never,
8
+ never,
9
+ never,
10
+ never,
11
+ never
12
+ > {
13
+ constructor(
14
+ plugins: JsoncOption["body"]["plugins"],
15
+ parser: JsoncOption["body"]["languageOptions"]["parser"],
16
+ ...files: string[]
17
+ ) {
18
+ super(
19
+ {
20
+ name: "linted/scope:jsonc",
21
+ files,
22
+ plugins,
23
+ linterOptions: {
24
+ noInlineConfig: true,
25
+ reportUnusedDisableDirectives: "error",
26
+ },
27
+ languageOptions: { parser },
28
+ },
29
+ );
30
+ }
31
+ }
@@ -0,0 +1,31 @@
1
+ import Option from "./option/Option.js";
2
+
3
+ export default class MdOption extends Option<
4
+ "md",
5
+ "yml",
6
+ true,
7
+ never,
8
+ never,
9
+ never,
10
+ never,
11
+ never
12
+ > {
13
+ constructor(
14
+ plugins: MdOption["body"]["plugins"],
15
+ parser: MdOption["body"]["languageOptions"]["parser"],
16
+ ...files: string[]
17
+ ) {
18
+ super(
19
+ {
20
+ name: "linted/scope:md",
21
+ files,
22
+ plugins,
23
+ linterOptions: {
24
+ noInlineConfig: true,
25
+ reportUnusedDisableDirectives: "error",
26
+ },
27
+ languageOptions: { parser },
28
+ },
29
+ );
30
+ }
31
+ }
@@ -0,0 +1,47 @@
1
+ import Option from "./option/Option.js";
2
+ import type TsOption from "./TsOption.js";
3
+
4
+ export default class SvelteOption extends Option<
5
+ "svelte",
6
+ | "svelte"
7
+ | keyof TsOption["body"]["plugins"]
8
+ ,
9
+ true,
10
+ & TsOption["body"]["languageOptions"]["parserOptions"]
11
+ & { parser: unknown }
12
+ & { extraFileExtensions: [".svelte"] },
13
+ never,
14
+ "svelte/svelte"
15
+ > {
16
+ constructor(
17
+ plugins: SvelteOption["body"]["plugins"],
18
+ svelteParser: SvelteOption["body"]["languageOptions"]["parser"],
19
+ tsParser: SvelteOption["body"]["languageOptions"]["parserOptions"]["parser"],
20
+ ...files: string[]
21
+ ) {
22
+ super(
23
+ {
24
+ name: "linted/scope:svelte",
25
+ processor: "svelte/svelte",
26
+ files,
27
+ plugins,
28
+ linterOptions: {
29
+ noInlineConfig: true,
30
+ reportUnusedDisableDirectives: "error",
31
+ },
32
+ languageOptions: {
33
+ ecmaVersion: "latest",
34
+ sourceType: "module",
35
+ parser: svelteParser,
36
+ parserOptions: {
37
+ ecmaVersion: "latest",
38
+ sourceType: "module",
39
+ project: "tsconfig.json",
40
+ extraFileExtensions: [".svelte"],
41
+ parser: tsParser,
42
+ },
43
+ },
44
+ },
45
+ );
46
+ }
47
+ }
@@ -0,0 +1,40 @@
1
+ import Option from "./option/Option.js";
2
+ import type JsOption from "./JsOption.js";
3
+
4
+ export default class TsOption extends Option<
5
+ "ts",
6
+ | "@typescript-eslint"
7
+ | keyof JsOption["body"]["plugins"]
8
+ ,
9
+ true,
10
+ & JsOption["body"]["languageOptions"]
11
+ & { project: "tsconfig.json" }
12
+ > {
13
+ constructor(
14
+ plugins: TsOption["body"]["plugins"],
15
+ parser: unknown,
16
+ ...files: string[]
17
+ ) {
18
+ super(
19
+ {
20
+ name: "linted/scope:ts",
21
+ files,
22
+ plugins,
23
+ linterOptions: {
24
+ noInlineConfig: true,
25
+ reportUnusedDisableDirectives: "error",
26
+ },
27
+ languageOptions: {
28
+ ecmaVersion: "latest",
29
+ sourceType: "module",
30
+ parser,
31
+ parserOptions: {
32
+ ecmaVersion: "latest",
33
+ sourceType: "module",
34
+ project: "tsconfig.json",
35
+ },
36
+ },
37
+ },
38
+ );
39
+ }
40
+ }
@@ -0,0 +1,31 @@
1
+ import Option from "./option/Option.js";
2
+
3
+ export default class YmlOption extends Option<
4
+ "yml",
5
+ "yml",
6
+ true,
7
+ never,
8
+ never,
9
+ never,
10
+ never,
11
+ never
12
+ > {
13
+ constructor(
14
+ plugins: YmlOption["body"]["plugins"],
15
+ parser: YmlOption["body"]["languageOptions"]["parser"],
16
+ ...files: string[]
17
+ ) {
18
+ super(
19
+ {
20
+ name: "linted/scope:yml",
21
+ files,
22
+ plugins,
23
+ linterOptions: {
24
+ noInlineConfig: true,
25
+ reportUnusedDisableDirectives: "error",
26
+ },
27
+ languageOptions: { parser },
28
+ },
29
+ );
30
+ }
31
+ }
@@ -0,0 +1,25 @@
1
+ export default class Option<
2
+ Scope extends string,
3
+ PluginId extends string,
4
+ UseParser extends boolean = never,
5
+ ParserOptions extends object = never,
6
+ GlobalTypes extends string = never,
7
+ ProcessorId extends string = never,
8
+ Source extends IOLanguageSource.Source = "module",
9
+ Ecma extends number | IOLanguageEcma.Ecma = "latest",
10
+ > {
11
+ constructor(
12
+ public readonly body: IOption<
13
+ `linted/scope:${literalful<Scope>}`,
14
+ true,
15
+ "error",
16
+ PluginId,
17
+ Ecma,
18
+ Source,
19
+ UseParser,
20
+ ParserOptions,
21
+ GlobalTypes,
22
+ ProcessorId
23
+ >,
24
+ ) {}
25
+ }
package/src/options.ts ADDED
@@ -0,0 +1,17 @@
1
+ import JsOption from "./options/JsOption.js";
2
+ import TsOption from "./options/TsOption.js";
3
+ import SvelteOption from "./options/SvelteOption.js";
4
+ import HtmlOption from "./options/HtmlOption.js";
5
+ import JsonOption from "./options/JsonOption.js";
6
+ import JsoncOption from "./options/JsoncOption.js";
7
+ import YmlOption from "./options/YmlOption.js";
8
+
9
+ export default {
10
+ js: JsOption,
11
+ ts: TsOption,
12
+ svelte: SvelteOption,
13
+ html: HtmlOption,
14
+ json: JsonOption,
15
+ jsonc: JsoncOption,
16
+ yml: YmlOption,
17
+ } satisfies Record<Scope, unknown>;
@@ -0,0 +1,24 @@
1
+ type PluginPackage = { configs: unknown };
2
+
3
+ declare interface Plugins extends Record<
4
+ Scope,
5
+ Record<
6
+ string,
7
+ { configs: unknown }
8
+ >
9
+ > {
10
+ js: { "@stylistic": PluginPackage };
11
+ ts: {
12
+ "@stylistic": PluginPackage;
13
+ "@typescript-eslint": PluginPackage;
14
+ };
15
+ svelte: {
16
+ "@stylistic": PluginPackage;
17
+ "@typescript-eslint": PluginPackage;
18
+ svelte: PluginPackage;
19
+ };
20
+ html: { "@html-eslint": PluginPackage };
21
+ json: { jsonc: PluginPackage };
22
+ jsonc: { jsonc: PluginPackage };
23
+ yml: { yml: PluginPackage };
24
+ }
@@ -0,0 +1,50 @@
1
+ import Rule from "./rule/Rule.js";
2
+
3
+ export { default as Rule } from "./rule/Rule.js";
4
+ export default class Ruleset<Language extends string> {
5
+ public readonly ruleset: readonly Rule[];
6
+ public readonly overrides: Rule[] = [];
7
+
8
+ constructor(
9
+ protected readonly language: literalful<Language>,
10
+ ...ruleset: readonly Rule[]
11
+ ) {
12
+ this.ruleset = [...ruleset];
13
+ }
14
+
15
+ public get id() {
16
+ return `ruleset:${this.language}` as const;
17
+ }
18
+
19
+ public get flat() {
20
+ return [
21
+ ...this.ruleset.map(
22
+ rules =>
23
+ rules.rules,
24
+ ),
25
+ ...this.overrides.map(
26
+ rules =>
27
+ rules.rules,
28
+ ),
29
+ ];
30
+ }
31
+
32
+ public override(...overrides: (undefined | IRule)[]) {
33
+ this.overrides.push(
34
+ ...overrides
35
+ .filter(
36
+ override =>
37
+ typeof override !== "undefined",
38
+ )
39
+ .map(
40
+ override =>
41
+ new Rule(
42
+ "override",
43
+ override,
44
+ ),
45
+ ),
46
+ );
47
+
48
+ return this;
49
+ }
50
+ }
@@ -0,0 +1,6 @@
1
+ export default class Rule {
2
+ constructor(
3
+ public readonly id: string,
4
+ public readonly rules: IRule,
5
+ ) {}
6
+ }
package/src/scopes.ts ADDED
@@ -0,0 +1,11 @@
1
+ const scopes = [
2
+ "js",
3
+ "ts",
4
+ "svelte",
5
+ "html",
6
+ "json",
7
+ "jsonc",
8
+ "yml",
9
+ ] as const satisfies Scope[];
10
+
11
+ export default scopes;