@eslinted/core 0.7.0-rc.3 → 0.7.0-rc.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. package/dist/boundary/input/input.d.ts +3 -2
  2. package/dist/boundary/input/input.d.ts.map +1 -1
  3. package/dist/boundary/input/parsers/parsers.d.ts +7 -0
  4. package/dist/boundary/input/parsers/parsers.d.ts.map +1 -0
  5. package/dist/boundary/input/parsers/parsers.js +2 -0
  6. package/dist/boundary/input/parsers/parsers.js.map +1 -0
  7. package/dist/boundary/input/plugins/plugins.d.ts +6 -0
  8. package/dist/boundary/input/plugins/plugins.d.ts.map +1 -0
  9. package/dist/boundary/input/plugins/plugins.js +2 -0
  10. package/dist/boundary/input/plugins/plugins.js.map +1 -0
  11. package/dist/boundary/output/config/IConfig.d.ts +19 -0
  12. package/dist/boundary/output/config/IConfig.d.ts.map +1 -0
  13. package/dist/boundary/output/config/IConfig.js +2 -0
  14. package/dist/boundary/output/config/IConfig.js.map +1 -0
  15. package/dist/boundary/output/output.d.ts +2 -2
  16. package/dist/boundary/output/output.d.ts.map +1 -1
  17. package/dist/factory/Factory.d.ts +1 -0
  18. package/dist/factory/Factory.d.ts.map +1 -1
  19. package/dist/factory/Factory.js.map +1 -1
  20. package/dist/factory/options/Options.d.ts +7 -7
  21. package/dist/factory/options/Options.d.ts.map +1 -1
  22. package/dist/factory/options/Options.js.map +1 -1
  23. package/dist/factory/options/option/Option.d.ts +26 -3
  24. package/dist/factory/options/option/Option.d.ts.map +1 -1
  25. package/dist/factory/options/option/Option.js +22 -3
  26. package/dist/factory/options/option/Option.js.map +1 -1
  27. package/dist/factory/options/option/html/index.d.ts +6 -2
  28. package/dist/factory/options/option/html/index.d.ts.map +1 -1
  29. package/dist/factory/options/option/html/index.js +5 -11
  30. package/dist/factory/options/option/html/index.js.map +1 -1
  31. package/dist/factory/options/option/js/index.d.ts +6 -1
  32. package/dist/factory/options/option/js/index.d.ts.map +1 -1
  33. package/dist/factory/options/option/js/index.js +7 -14
  34. package/dist/factory/options/option/js/index.js.map +1 -1
  35. package/dist/factory/options/option/json/index.d.ts +6 -2
  36. package/dist/factory/options/option/json/index.d.ts.map +1 -1
  37. package/dist/factory/options/option/json/index.js +5 -11
  38. package/dist/factory/options/option/json/index.js.map +1 -1
  39. package/dist/factory/options/option/jsonc/index.d.ts +6 -2
  40. package/dist/factory/options/option/jsonc/index.d.ts.map +1 -1
  41. package/dist/factory/options/option/jsonc/index.js +5 -11
  42. package/dist/factory/options/option/jsonc/index.js.map +1 -1
  43. package/dist/factory/options/option/svelte/index.d.ts +21 -4
  44. package/dist/factory/options/option/svelte/index.d.ts.map +1 -1
  45. package/dist/factory/options/option/svelte/index.js +13 -20
  46. package/dist/factory/options/option/svelte/index.js.map +1 -1
  47. package/dist/factory/options/option/ts/index.d.ts +14 -3
  48. package/dist/factory/options/option/ts/index.d.ts.map +1 -1
  49. package/dist/factory/options/option/ts/index.js +11 -17
  50. package/dist/factory/options/option/ts/index.js.map +1 -1
  51. package/dist/factory/options/option/yml/index.d.ts +6 -2
  52. package/dist/factory/options/option/yml/index.d.ts.map +1 -1
  53. package/dist/factory/options/option/yml/index.js +5 -11
  54. package/dist/factory/options/option/yml/index.js.map +1 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +26 -15
  57. package/dist/index.js.map +1 -1
  58. package/package.json +1 -1
  59. package/src/boundary/input/input.ts +4 -2
  60. package/src/boundary/input/parsers/parsers.ts +10 -0
  61. package/src/boundary/input/plugins/plugins.ts +7 -0
  62. package/src/boundary/output/config/{index.ts → IConfig.ts} +3 -4
  63. package/src/boundary/output/config/interface/option/IOption.d.ts +15 -20
  64. package/src/boundary/output/config/interface/option/language/IOLanguage.d.ts +16 -13
  65. package/src/boundary/output/config/interface/option/language/ecma/IOLanguageEcma.d.ts +1 -19
  66. package/src/boundary/output/config/interface/option/language/globals/IOLanguageGlobals.d.ts +1 -3
  67. package/src/boundary/output/config/interface/option/language/source/IOLanguageSource.d.ts +3 -12
  68. package/src/boundary/output/config/interface/option/linter/IOLinter.d.ts +3 -29
  69. package/src/boundary/output/config/interface/option/name/IOName.d.ts +1 -3
  70. package/src/boundary/output/config/interface/option/plugins/IOPlugins.d.ts +1 -3
  71. package/src/boundary/output/config/interface/option/processor/IOProcessor.d.ts +1 -3
  72. package/src/boundary/output/output.ts +2 -2
  73. package/src/factory/Factory.ts +1 -0
  74. package/src/factory/options/Options.ts +1 -1
  75. package/src/factory/options/option/Option.ts +47 -16
  76. package/src/factory/options/option/html/index.ts +9 -22
  77. package/src/factory/options/option/js/index.ts +8 -19
  78. package/src/factory/options/option/json/index.ts +9 -22
  79. package/src/factory/options/option/jsonc/index.ts +9 -22
  80. package/src/factory/options/option/svelte/index.ts +22 -33
  81. package/src/factory/options/option/ts/index.ts +19 -28
  82. package/src/factory/options/option/yml/index.ts +9 -22
  83. package/src/index.ts +30 -23
  84. package/types/project/OmitLast.d.ts +1 -0
  85. package/src/boundary/input/parsers/index.ts +0 -12
  86. package/src/boundary/input/plugins/index.ts +0 -20
  87. package/src/boundary/output/config/interface/files/IFiles.d.ts +0 -1
  88. package/src/boundary/output/config/interface/option/language/parser/IOLanguageParser.d.ts +0 -3
  89. package/src/boundary/output/config/interface/option/language/parserOptions/IOLanguageParserOptions.d.ts +0 -5
  90. package/src/boundary/output/config/interface/rules/IRules.d.ts +0 -1
  91. /package/src/boundary/output/config/interface/rules/{rule/IRule.d.ts → IRule.d.ts} +0 -0
  92. /package/src/boundary/output/config/interface/rules/{rule/state → state}/RuleSeverity.d.ts +0 -0
  93. /package/types/{literal → typioca/literal}/number/base32.d.ts +0 -0
  94. /package/types/{literal → typioca/literal}/number/base64.d.ts +0 -0
  95. /package/types/{literal → typioca/literal}/number/binary.d.ts +0 -0
  96. /package/types/{literal → typioca/literal}/number/decimal.d.ts +0 -0
  97. /package/types/{literal → typioca/literal}/number/hex.d.ts +0 -0
  98. /package/types/{literal → typioca/literal}/number/octal.d.ts +0 -0
  99. /package/types/{literal → typioca/literal}/number/quatral.d.ts +0 -0
  100. /package/types/{literal → typioca/literal}/number/ternary.d.ts +0 -0
  101. /package/types/{literal → typioca/literal}/string/base64char.d.ts +0 -0
  102. /package/types/{literal → typioca/literal}/string/digit.d.ts +0 -0
  103. /package/types/{literal → typioca/literal}/string/hexchar.d.ts +0 -0
  104. /package/types/{literal → typioca/literal}/string/letter.d.ts +0 -0
  105. /package/types/{safe → typioca/safe}/Safe.d.ts +0 -0
  106. /package/types/{safe → typioca/safe}/numbers/finite/Finite.d.ts +0 -0
  107. /package/types/{safe → typioca/safe}/numbers/finite.d.ts +0 -0
  108. /package/types/{safe → typioca/safe}/numbers/fint.d.ts +0 -0
  109. /package/types/{safe → typioca/safe}/numbers/int/Int.d.ts +0 -0
  110. /package/types/{safe → typioca/safe}/numbers/int.d.ts +0 -0
  111. /package/types/{safe → typioca/safe}/numbers/numberful.d.ts +0 -0
  112. /package/types/{safe → typioca/safe}/numbers/polarity/Negative.d.ts +0 -0
  113. /package/types/{safe → typioca/safe}/numbers/polarity/Positive.d.ts +0 -0
  114. /package/types/{safe → typioca/safe}/numbers/polarity/pole/Pole.d.ts +0 -0
  115. /package/types/{safe → typioca/safe}/primitive.d.ts +0 -0
  116. /package/types/{safe → typioca/safe}/strings/char.d.ts +0 -0
  117. /package/types/{safe → typioca/safe}/strings/length/PropLength.d.ts +0 -0
  118. /package/types/{safe → typioca/safe}/strings/stringful.d.ts +0 -0
  119. /package/types/{utility → typioca/utility}/interface/construct/Particord.d.ts +0 -0
  120. /package/types/{utility → typioca/utility}/interface/construct/Property.d.ts +0 -0
  121. /package/types/{utility → typioca/utility}/interface/construct/Recordful.d.ts +0 -0
  122. /package/types/{utility → typioca/utility}/interface/construct/Table.d.ts +0 -0
  123. /package/types/{utility → typioca/utility}/interface/construct/properties/Field.d.ts +0 -0
  124. /package/types/{utility → typioca/utility}/interface/construct/properties/Flag.d.ts +0 -0
  125. /package/types/{utility → typioca/utility}/interface/construct/properties/Limit.d.ts +0 -0
  126. /package/types/{utility → typioca/utility}/interface/construct/properties/List.d.ts +0 -0
  127. /package/types/{utility → typioca/utility}/interface/construct/properties/Listish.d.ts +0 -0
  128. /package/types/{utility → typioca/utility}/interface/construct/properties/Scalar.d.ts +0 -0
  129. /package/types/{utility → typioca/utility}/interface/construct/tables/FieldTable.d.ts +0 -0
  130. /package/types/{utility → typioca/utility}/interface/construct/tables/FlagTable.d.ts +0 -0
  131. /package/types/{utility → typioca/utility}/interface/construct/tables/ListTable.d.ts +0 -0
  132. /package/types/{utility → typioca/utility}/interface/construct/tables/ListishTable.d.ts +0 -0
  133. /package/types/{utility → typioca/utility}/interface/construct/tables/ScalarTable.d.ts +0 -0
  134. /package/types/{utility → typioca/utility}/interface/identity/Interface.d.ts +0 -0
  135. /package/types/{utility → typioca/utility}/interface/identity/Keys.d.ts +0 -0
  136. /package/types/{utility → typioca/utility}/interface/transform/Unrequire.d.ts +0 -0
  137. /package/types/{utility → typioca/utility}/iterable/construct/ArrayN.d.ts +0 -0
  138. /package/types/{utility → typioca/utility}/iterable/construct/Tuple.d.ts +0 -0
  139. /package/types/{utility → typioca/utility}/iterable/construct/arrays/Arrays.d.ts +0 -0
  140. /package/types/{utility → typioca/utility}/iterable/construct/tuples/Tuples.d.ts +0 -0
  141. /package/types/{utility → typioca/utility}/iterable/identity/DyadType.d.ts +0 -0
  142. /package/types/{utility → typioca/utility}/iterable/identity/MonadType.d.ts +0 -0
  143. /package/types/{utility → typioca/utility}/iterable/identity/TriadType.d.ts +0 -0
  144. /package/types/{utility → typioca/utility}/iterable/identity/array/ArrayType.d.ts +0 -0
  145. /package/types/{utility → typioca/utility}/iterable/identity/array/length/ArrayLength.d.ts +0 -0
  146. /package/types/{utility → typioca/utility}/iterable/transform/Join.d.ts +0 -0
  147. /package/types/{utility → typioca/utility}/iterable/transform/Unflat.d.ts +0 -0
  148. /package/types/{utility → typioca/utility}/iterable/transform/stringarray/Chain.d.ts +0 -0
  149. /package/types/{utility → typioca/utility}/iterable/transform/stringarray/PathN.d.ts +0 -0
  150. /package/types/{utility → typioca/utility}/iterable/transform/stringarray/stringify/Stringify.d.ts +0 -0
  151. /package/types/{utility → typioca/utility}/length/Length.d.ts +0 -0
  152. /package/types/{utility → typioca/utility}/null/null.d.ts +0 -0
  153. /package/types/{utility → typioca/utility}/null/nullable.d.ts +0 -0
  154. /package/types/{utility → typioca/utility}/primitive/Primeval.d.ts +0 -0
  155. /package/types/{utility → typioca/utility}/primitive/boolean/True.d.ts +0 -0
  156. /package/types/{utility → typioca/utility}/primitive/number/Numbered.d.ts +0 -0
  157. /package/types/{utility → typioca/utility}/primitive/string/literal.d.ts +0 -0
  158. /package/types/{utility → typioca/utility}/primitive/string/literalful.d.ts +0 -0
@@ -3,43 +3,32 @@ import type TsOption from "../ts/index.js";
3
3
 
4
4
  export default class SvelteOption extends Option<
5
5
  "svelte",
6
- "svelte" | keyof TsOption["body"]["plugins"],
6
+ "svelte" | keyof TsOption["option"]["plugins"],
7
7
  true,
8
- & TsOption["body"]["languageOptions"]["parserOptions"]
8
+ & TsOption["option"]["languageOptions"]["parserOptions"]
9
9
  & { parser: unknown }
10
- & { extraFileExtensions: [".svelte"] },
10
+ & { extraFileExtensions: readonly [".svelte"] },
11
+ 2,
11
12
  never,
12
- "svelte/svelte"
13
+ { processor: "svelte/svelte" }
13
14
  > {
14
- constructor(
15
- plugins: SvelteOption["body"]["plugins"],
16
- svelteParser: SvelteOption["body"]["languageOptions"]["parser"],
17
- tsParser: SvelteOption["body"]["languageOptions"]["parserOptions"]["parser"],
18
- files: readonly string[],
19
- ) {
20
- super(
21
- {
22
- name: "linted/scope:svelte",
23
- processor: "svelte/svelte",
24
- files,
25
- plugins,
26
- linterOptions: {
27
- noInlineConfig: true,
28
- reportUnusedDisableDirectives: "error",
29
- },
30
- languageOptions: {
31
- ecmaVersion: "latest",
32
- sourceType: "module",
33
- parser: svelteParser,
34
- parserOptions: {
35
- ecmaVersion: "latest",
36
- sourceType: "module",
37
- project: "tsconfig.json",
38
- extraFileExtensions: [".svelte"],
39
- parser: tsParser,
40
- },
41
- },
15
+ public readonly name = "scope:svelte";
16
+ public readonly processor = { processor: "svelte/svelte" } as const;
17
+
18
+ public get languageOptions() {
19
+ const [parser, tsParser] = this.parser;
20
+
21
+ return {
22
+ ecmaVersion: "latest",
23
+ sourceType: "module",
24
+ parser,
25
+ parserOptions: {
26
+ ecmaVersion: "latest",
27
+ sourceType: "module",
28
+ project: "tsconfig.json",
29
+ extraFileExtensions: [".svelte"] as const,
30
+ parser: tsParser,
42
31
  },
43
- );
32
+ } as const;
44
33
  }
45
34
  }
@@ -3,36 +3,27 @@ import type JsOption from "../js/index.js";
3
3
 
4
4
  export default class TsOption extends Option<
5
5
  "ts",
6
- "@typescript-eslint" | keyof JsOption["body"]["plugins"],
6
+ "@typescript-eslint" | keyof JsOption["option"]["plugins"],
7
7
  true,
8
- & JsOption["body"]["languageOptions"]
9
- & { project: "tsconfig.json" }
8
+ & JsOption["option"]["languageOptions"]
9
+ & { project: "tsconfig.json" },
10
+ 1
10
11
  > {
11
- constructor(
12
- plugins: TsOption["body"]["plugins"],
13
- parser: unknown,
14
- files: readonly string[],
15
- ) {
16
- super(
17
- {
18
- name: "linted/scope:ts",
19
- files,
20
- plugins,
21
- linterOptions: {
22
- noInlineConfig: true,
23
- reportUnusedDisableDirectives: "error",
24
- },
25
- languageOptions: {
26
- ecmaVersion: "latest",
27
- sourceType: "module",
28
- parser,
29
- parserOptions: {
30
- ecmaVersion: "latest",
31
- sourceType: "module",
32
- project: "tsconfig.json",
33
- },
34
- },
12
+ public readonly name = "scope:ts";
13
+ public readonly processor = {} as const;
14
+
15
+ public get languageOptions() {
16
+ const [parser] = this.parser;
17
+
18
+ return {
19
+ ecmaVersion: "latest",
20
+ sourceType: "module",
21
+ parser,
22
+ parserOptions: {
23
+ ecmaVersion: "latest",
24
+ sourceType: "module",
25
+ project: "tsconfig.json",
35
26
  },
36
- );
27
+ } as const;
37
28
  }
38
29
  }
@@ -3,29 +3,16 @@ import Option from "../Option.js";
3
3
  export default class YmlOption extends Option<
4
4
  "yml",
5
5
  "yml",
6
+ false,
6
7
  true,
7
- never,
8
- never,
9
- never,
10
- never,
11
- never
8
+ 1
12
9
  > {
13
- constructor(
14
- plugins: YmlOption["body"]["plugins"],
15
- parser: YmlOption["body"]["languageOptions"]["parser"],
16
- files: readonly 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
- );
10
+ public readonly name = "scope:yml";
11
+ public readonly processor = {} as const;
12
+
13
+ public get languageOptions() {
14
+ const [parser] = this.parser;
15
+
16
+ return { parser } as const;
30
17
  }
31
18
  }
package/src/index.ts CHANGED
@@ -26,7 +26,21 @@ export default function (
26
26
  const files = new Files(
27
27
  base,
28
28
  includes,
29
- );
29
+ ),
30
+ imports: {
31
+ [S in Scope]: OmitFirst<ConstructorParameters<typeof Options[S]>>;
32
+ } = {
33
+ js: [plugins.js, []] as const,
34
+ ts: [plugins.ts, [parsers.ts]] as const,
35
+ svelte: [
36
+ plugins.svelte,
37
+ [parsers.svelte, parsers.ts],
38
+ ] as const,
39
+ html: [plugins.html, [parsers.html]] as const,
40
+ json: [plugins.json, [parsers.json]] as const,
41
+ jsonc: [plugins.jsonc, [parsers.jsonc]] as const,
42
+ yml: [plugins.yml, [parsers.yml]] as const,
43
+ } as const;
30
44
 
31
45
  for (const scope of scopes)
32
46
  rulesets[scope].override(overrides[scope]);
@@ -34,57 +48,50 @@ export default function (
34
48
  const options: {
35
49
  [S in Scope]: InstanceType<
36
50
  typeof Options[S]
37
- >["body"]
51
+ >["option"]
38
52
  } = {
39
53
  js: new Options
40
54
  .js(
41
- plugins.js,
42
55
  files.files("js"),
56
+ ...imports.js,
43
57
  )
44
- .body,
58
+ .option,
45
59
  ts: new Options
46
60
  .ts(
47
- plugins.ts,
48
- parsers.ts,
49
61
  files.files("ts"),
62
+ ...imports.ts,
50
63
  )
51
- .body,
64
+ .option,
52
65
  svelte: new Options
53
66
  .svelte(
54
- plugins.svelte,
55
- parsers.svelte,
56
- parsers.ts,
57
67
  files.files("svelte"),
68
+ ...imports.svelte,
58
69
  )
59
- .body,
70
+ .option,
60
71
  html: new Options
61
72
  .html(
62
- plugins.html,
63
- parsers.html,
64
73
  files.files("html"),
74
+ ...imports.html,
65
75
  )
66
- .body,
76
+ .option,
67
77
  json: new Options
68
78
  .json(
69
- plugins.json,
70
- parsers.json,
71
79
  files.files("json"),
80
+ ...imports.json,
72
81
  )
73
- .body,
82
+ .option,
74
83
  jsonc: new Options
75
84
  .jsonc(
76
- plugins.jsonc,
77
- parsers.jsonc,
78
85
  files.files("jsonc"),
86
+ ...imports.jsonc,
79
87
  )
80
- .body,
88
+ .option,
81
89
  yml: new Options
82
90
  .yml(
83
- plugins.yml,
84
- parsers.yml,
85
91
  files.files("yml"),
92
+ ...imports.yml,
86
93
  )
87
- .body,
94
+ .option,
88
95
  };
89
96
 
90
97
  return scopes
@@ -0,0 +1 @@
1
+ declare type OmitFirst<A> = A extends readonly [unknown, ...infer An_1] ? An_1 : never;
@@ -1,12 +0,0 @@
1
- import type { Scope } from "../input.js";
2
-
3
- type ParsedScopes = Scope & (
4
- | "ts"
5
- | "svelte"
6
- | "html"
7
- | "json"
8
- | "jsonc"
9
- | "yml"
10
- );
11
-
12
- export type Parsers = Record<ParsedScopes, unknown>;
@@ -1,20 +0,0 @@
1
- import type { Scope } from "../input.js";
2
-
3
- type PluginImport = { configs: unknown };
4
-
5
- export default interface Plugins extends Record<Scope, Record<string, PluginImport>> {
6
- js: { "@stylistic": PluginImport };
7
- ts: {
8
- "@stylistic": PluginImport;
9
- "@typescript-eslint": PluginImport;
10
- };
11
- svelte: {
12
- "@stylistic": PluginImport;
13
- "@typescript-eslint": PluginImport;
14
- svelte: PluginImport;
15
- };
16
- html: { "@html-eslint": PluginImport };
17
- json: { jsonc: PluginImport };
18
- jsonc: { jsonc: PluginImport };
19
- yml: { yml: PluginImport };
20
- }
@@ -1 +0,0 @@
1
- declare interface IFiles { files: readonly string[] }
@@ -1,3 +0,0 @@
1
- declare type IOLanguageParser<UseParser extends boolean> = True<UseParser> extends never
2
- ? object
3
- : { parser: unknown };
@@ -1,5 +0,0 @@
1
- declare type IOLanguageParserOptions<ParserOptions extends object> = Interface<ParserOptions> extends never
2
- ? object
3
- : Keys<ParserOptions> extends never
4
- ? object
5
- : { parserOptions: Interface<ParserOptions> };
@@ -1 +0,0 @@
1
- declare interface IRules { rules: IRule }
File without changes
File without changes
File without changes
File without changes
File without changes