@eslinted/core 23.1.4 → 24.1.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 (50) hide show
  1. package/dist/_test/index.d.ts +38 -40
  2. package/dist/_test/index.d.ts.map +1 -1
  3. package/dist/_test/index.js +17 -19
  4. package/dist/_test/index.js.map +1 -1
  5. package/dist/factory.d.ts +22 -10
  6. package/dist/factory.d.ts.map +1 -1
  7. package/dist/factory.js +39 -24
  8. package/dist/factory.js.map +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +3 -22
  12. package/dist/index.js.map +1 -1
  13. package/dist/interface/config/rule.d.ts +1 -1
  14. package/dist/interface/config/rule.d.ts.map +1 -1
  15. package/dist/interface/input/configuration/extensions.d.ts +4 -1
  16. package/dist/interface/input/configuration/extensions.d.ts.map +1 -1
  17. package/dist/interface/input/configuration/index.d.ts +2 -2
  18. package/dist/interface/input/configuration/index.d.ts.map +1 -1
  19. package/dist/interface/input/configuration/settings.d.ts +1 -1
  20. package/dist/interface/input/configuration/settings.d.ts.map +1 -1
  21. package/dist/interface/input/imports.d.ts +5 -0
  22. package/dist/interface/input/imports.d.ts.map +1 -0
  23. package/dist/interface/input/imports.js +2 -0
  24. package/dist/interface/input/imports.js.map +1 -0
  25. package/dist/interface/input/index.d.ts +4 -4
  26. package/dist/interface/input/index.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/src/_test/index.ts +18 -20
  29. package/src/factory.ts +62 -49
  30. package/src/index.ts +10 -35
  31. package/src/interface/config/rule.ts +5 -2
  32. package/src/interface/input/configuration/extensions.ts +10 -0
  33. package/src/interface/input/configuration/index.ts +6 -2
  34. package/src/interface/input/configuration/settings.ts +1 -1
  35. package/src/interface/input/{imports/required.ts → imports.ts} +1 -1
  36. package/src/interface/input/index.ts +7 -7
  37. package/dist/interface/input/imports/index.d.ts +0 -7
  38. package/dist/interface/input/imports/index.d.ts.map +0 -1
  39. package/dist/interface/input/imports/index.js +0 -2
  40. package/dist/interface/input/imports/index.js.map +0 -1
  41. package/dist/interface/input/imports/optional.d.ts +0 -5
  42. package/dist/interface/input/imports/optional.d.ts.map +0 -1
  43. package/dist/interface/input/imports/optional.js +0 -2
  44. package/dist/interface/input/imports/optional.js.map +0 -1
  45. package/dist/interface/input/imports/required.d.ts +0 -5
  46. package/dist/interface/input/imports/required.d.ts.map +0 -1
  47. package/dist/interface/input/imports/required.js +0 -2
  48. package/dist/interface/input/imports/required.js.map +0 -1
  49. package/src/interface/input/imports/index.ts +0 -16
  50. package/src/interface/input/imports/optional.ts +0 -11
@@ -1,23 +1,21 @@
1
1
  export declare const TEST_INPUT: {
2
2
  imports: {
3
- required: {
4
- plugins: {
5
- "@stylistic": string;
6
- "@typescript-eslint": string;
7
- mocha: string;
8
- "chai-friendly": string;
9
- "chai-expect": string;
10
- "@html-eslint": string;
11
- css: string;
12
- json: string;
13
- jsonc: string;
14
- yml: string;
15
- };
16
- parsers: {
17
- ts: string;
18
- html: string;
19
- yml: string;
20
- };
3
+ plugins: {
4
+ "@stylistic": string;
5
+ "@typescript-eslint": string;
6
+ mocha: string;
7
+ "chai-friendly": string;
8
+ "chai-expect": string;
9
+ "@html-eslint": string;
10
+ css: string;
11
+ json: string;
12
+ jsonc: string;
13
+ yml: string;
14
+ };
15
+ parsers: {
16
+ ts: string;
17
+ html: string;
18
+ yml: string;
21
19
  };
22
20
  };
23
21
  configuration: {
@@ -124,16 +122,16 @@ export declare const TEST_INPUT: {
124
122
  js: ({
125
123
  id: string;
126
124
  rules: {
127
- readonly vanilla: "error";
128
- readonly vanilla0: "error";
129
- readonly vanilla1: "error";
130
- readonly vanilla2: "error";
125
+ readonly vanilla: 2;
126
+ readonly vanilla0: 2;
127
+ readonly vanilla1: 2;
128
+ readonly vanilla2: 2;
131
129
  readonly "@stylistic/style-rule"?: never;
132
130
  };
133
131
  } | {
134
132
  id: string;
135
133
  rules: {
136
- readonly "@stylistic/style-rule": "error";
134
+ readonly "@stylistic/style-rule": 2;
137
135
  readonly vanilla?: never;
138
136
  readonly vanilla0?: never;
139
137
  readonly vanilla1?: never;
@@ -143,7 +141,7 @@ export declare const TEST_INPUT: {
143
141
  ts: ({
144
142
  id: string;
145
143
  rules: {
146
- readonly vanilla0: "off";
144
+ readonly vanilla0: 0;
147
145
  readonly "@typescript-eslint/enums"?: never;
148
146
  readonly "@typescript-eslint/destructure-expression"?: never;
149
147
  readonly "@typescript-eslint/global"?: never;
@@ -151,30 +149,30 @@ export declare const TEST_INPUT: {
151
149
  } | {
152
150
  id: string;
153
151
  rules: {
154
- readonly "@typescript-eslint/enums": "error";
155
- readonly "@typescript-eslint/destructure-expression": "error";
156
- readonly "@typescript-eslint/global": "error";
152
+ readonly "@typescript-eslint/enums": 2;
153
+ readonly "@typescript-eslint/destructure-expression": 2;
154
+ readonly "@typescript-eslint/global": 2;
157
155
  readonly vanilla0?: never;
158
156
  };
159
157
  })[];
160
158
  mocha: ({
161
159
  id: string;
162
160
  rules: {
163
- readonly vanilla2: "off";
161
+ readonly vanilla2: 0;
164
162
  readonly "@typescript-eslint/global"?: never;
165
163
  readonly "mocha/test-expression"?: never;
166
164
  };
167
165
  } | {
168
166
  id: string;
169
167
  rules: {
170
- readonly "@typescript-eslint/global": "error";
168
+ readonly "@typescript-eslint/global": 2;
171
169
  readonly vanilla2?: never;
172
170
  readonly "mocha/test-expression"?: never;
173
171
  };
174
172
  } | {
175
173
  id: string;
176
174
  rules: {
177
- readonly "mocha/test-expression": "error";
175
+ readonly "mocha/test-expression": 2;
178
176
  readonly vanilla2?: never;
179
177
  readonly "@typescript-eslint/global"?: never;
180
178
  };
@@ -182,52 +180,52 @@ export declare const TEST_INPUT: {
182
180
  svelte: ({
183
181
  id: string;
184
182
  rules: {
185
- readonly vanilla1: "off";
183
+ readonly vanilla1: 0;
186
184
  readonly "svelte/tags"?: never;
187
185
  };
188
186
  } | {
189
187
  id: string;
190
188
  rules: {
191
- readonly "svelte/tags": "error";
189
+ readonly "svelte/tags": 2;
192
190
  readonly vanilla1?: never;
193
191
  };
194
192
  })[];
195
193
  html: {
196
194
  id: string;
197
195
  rules: {
198
- readonly "html/attribute": "error";
196
+ readonly "html/attribute": 2;
199
197
  };
200
198
  }[];
201
199
  css: {
202
200
  id: string;
203
201
  rules: {
204
- readonly "css/property": "error";
202
+ readonly "css/property": 2;
205
203
  };
206
204
  }[];
207
205
  json: {
208
206
  id: string;
209
207
  rules: {
210
- readonly "jsonc/property-check": "error";
211
- readonly "jsonc/comment": readonly ["error", "never"];
212
- readonly "jsonc/trailing-comma": readonly ["error", "never"];
208
+ readonly "jsonc/property-check": 2;
209
+ readonly "jsonc/comment": readonly [2, "never"];
210
+ readonly "jsonc/trailing-comma": readonly [2, "never"];
213
211
  };
214
212
  }[];
215
213
  jsonc: {
216
214
  id: string;
217
215
  rules: {
218
- readonly "jsonc/comment": readonly ["error", "allow"];
216
+ readonly "jsonc/comment": readonly [2, "allow"];
219
217
  };
220
218
  }[];
221
219
  jsoncc: {
222
220
  id: string;
223
221
  rules: {
224
- readonly "jsonc/trailing-comma": readonly ["error", "allow"];
222
+ readonly "jsonc/trailing-comma": readonly [2, "allow"];
225
223
  };
226
224
  }[];
227
225
  yml: {
228
226
  id: string;
229
227
  rules: {
230
- readonly "yml/property-check": "error";
228
+ readonly "yml/property-check": 2;
231
229
  };
232
230
  }[];
233
231
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/_test/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiQtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/_test/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+PtB,CAAC"}
@@ -1,24 +1,22 @@
1
- const ERROR = "error", OFF = "off", Plugin = "MOCK_PLUGIN", Parser = (scope) => `MOCK_PARSER:${scope}`;
1
+ const ERROR = 2, OFF = 0, Plugin = "MOCK_PLUGIN", Parser = (scope) => `MOCK_PARSER:${scope}`;
2
2
  export const TEST_INPUT = {
3
3
  imports: {
4
- required: {
5
- plugins: {
6
- "@stylistic": Plugin,
7
- "@typescript-eslint": Plugin,
8
- mocha: Plugin,
9
- "chai-friendly": Plugin,
10
- "chai-expect": Plugin,
11
- "@html-eslint": Plugin,
12
- css: Plugin,
13
- json: Plugin,
14
- jsonc: Plugin,
15
- yml: Plugin,
16
- },
17
- parsers: {
18
- ts: Parser("TS"),
19
- html: Parser("HTML"),
20
- yml: Parser("YML"),
21
- },
4
+ plugins: {
5
+ "@stylistic": Plugin,
6
+ "@typescript-eslint": Plugin,
7
+ mocha: Plugin,
8
+ "chai-friendly": Plugin,
9
+ "chai-expect": Plugin,
10
+ "@html-eslint": Plugin,
11
+ css: Plugin,
12
+ json: Plugin,
13
+ jsonc: Plugin,
14
+ yml: Plugin,
15
+ },
16
+ parsers: {
17
+ ts: Parser("TS"),
18
+ html: Parser("HTML"),
19
+ yml: Parser("YML"),
22
20
  },
23
21
  },
24
22
  configuration: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/_test/index.ts"],"names":[],"mappings":"AAAA,MACA,KAAK,GAAG,OAAO,EACf,GAAG,GAAG,KAAK,EACX,MAAM,GAAG,aAAa,EACtB,MAAM,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,eAAe,KAAK,EAAE,CAAC;AAEnD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,YAAY,EAAE,MAAM;gBACpB,oBAAoB,EAAE,MAAM;gBAC5B,KAAK,EAAE,MAAM;gBACb,eAAe,EAAE,MAAM;gBACvB,aAAa,EAAE,MAAM;gBACrB,cAAc,EAAE,MAAM;gBACtB,GAAG,EAAE,MAAM;gBACX,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,MAAM;gBACb,GAAG,EAAE,MAAM;aACZ;YACD,OAAO,EAAE;gBACP,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC;gBAChB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;gBACpB,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC;aACnB;SACF;KACF;IACD,aAAa,EAAE;QACb,QAAQ,EAAE;YACR,MAAM,EAAE;gBACN,WAAW,EAAE,IAAI;gBACjB,UAAU,EAAE,QAAQ;gBACpB,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aAC9B;YACV,QAAQ,EAAE;gBACR,EAAE,EAAE;oBACF,eAAe,EAAE,EAAE;oBACnB,aAAa,EAAE,EAAE;iBAClB;gBACD,EAAE,EAAE;oBACF,eAAe,EAAE;wBACf,MAAM,EAAE,IAAa;qBACtB;oBACD,aAAa,EAAE,EAAE;iBAClB;gBACD,KAAK,EAAE;oBACL,eAAe,EAAE,EAAE;oBACnB,aAAa,EAAE,EAAE;iBAClB;gBACD,MAAM,EAAE;oBACN,eAAe,EAAE;wBACf,MAAM,EAAE,QAAiB;q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,uBAAuB,EAAE,KAAK;yBACtB;qBACX;iBACF;gBACD,MAAM,EAAE;oBACN;wBACE,EAAE,EAAE,SAAS;wBACb,KAAK,EAAE;4BACL,QAAQ,EAAE,GAAG;yBACL;qBACX;oBACD;wBACE,EAAE,EAAE,kBAAkB;wBACtB,KAAK,EAAE;4BACL,aAAa,EAAE,KAAK;yBACZ;qBACX;iBACF;gBACD,IAAI,EAAE;oBACJ;wBACE,EAAE,EAAE,QAAQ;wBACZ,KAAK,EAAE;4BACL,gBAAgB,EAAE,KAAK;yBACf;qBACX;iBACF;gBACD,GAAG,EAAE;oBACH;wBACE,EAAE,EAAE,QAAQ;wBACZ,KAAK,EAAE;4BACL,cAAc,EAAE,KAAK;yBACb;qBACX;iBACF;gBACD,IAAI,EAAE;oBACJ;wBACE,EAAE,EAAE,QAAQ;wBACZ,KAAK,EAAE;4BACL,sBAAsB,EAAE,KAAK;4BAC7B,eAAe,EAAE;gCACf,KAAK;gCACL,OAAO;6BACR;4BACD,sBAAsB,EAAE;gCACtB,KAAK;gCACL,OAAO;6BACR;yBACO;qBACX;iBACF;gBACD,KAAK,EAAE;oBACL;wBACE,EAAE,EAAE,kBAAkB;wBACtB,KAAK,EAAE;4BACL,eAAe,EAAE;gCACf,KAAK;gCACL,OAAO;6BACR;yBACO;qBACX;iBACF;gBACD,MAAM,EAAE;oBACN;wBACE,EAAE,EAAE,gBAAgB;wBACpB,KAAK,EAAE;4BACL,sBAAsB,EAAE;gCACtB,KAAK;gCACL,OAAO;6BACR;yBACO;qBACX;iBACF;gBACD,GAAG,EAAE;oBACH;wBACE,EAAE,EAAE,QAAQ;wBACZ,KAAK,EAAE;4BACL,oBAAoB,EAAE,KAAK;yBACnB;qBACX;iBACF;aACF;SACF;QACD,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,EAAE;KAChB;CACF,CAAC"}
package/dist/factory.d.ts CHANGED
@@ -1,14 +1,19 @@
1
1
  import type { Input } from "./interface/index.js";
2
- export declare class Factory<RequiredPlugin extends string, RequiredParser extends string, OptionalImport extends string, Scope extends string> {
2
+ export declare class Factory<RequiredPlugin extends string, RequiredParser extends Scope, Scope extends string, OptionalScope extends Scope> {
3
3
  private readonly settings;
4
- parsers: Record<RequiredParser, unknown> & Partial<Record<OptionalImport, unknown>>;
5
- readonly attachments: Input<RequiredPlugin, RequiredParser, OptionalImport, Scope>["configuration"]["attachments"];
6
- global: {
4
+ readonly attachments: Input<RequiredPlugin, RequiredParser, Scope, OptionalScope>["configuration"]["attachments"];
5
+ globalConfigs: {
6
+ plugins: {
7
+ name: "linted/*/plugins/";
8
+ plugins: Record<RequiredPlugin, unknown> & {
9
+ svelte?: unknown;
10
+ };
11
+ };
7
12
  settings: {
8
13
  name: "linted/*/settings/";
9
14
  linterOptions: {
10
15
  noInlineConfig: boolean;
11
- reportUnusedDisableDirectives: "error" | "warn" | "off";
16
+ reportUnusedDisableDirectives: "off" | "warn" | "error";
12
17
  };
13
18
  languageOptions: {
14
19
  sourceType: "module" | "script";
@@ -28,16 +33,23 @@ export declare class Factory<RequiredPlugin extends string, RequiredParser exten
28
33
  rules: import("./interface/index.js").IConfig["rules"];
29
34
  }[]>;
30
35
  };
31
- constructor(optionalScopes: readonly Scope[], tree: Array<readonly [
36
+ parsers: Record<RequiredParser, unknown> & Partial<Record<OptionalScope, unknown>>;
37
+ constructor(tree: Array<readonly [
32
38
  Scope,
33
39
  readonly Scope[]
34
- ]>, settings: Input<RequiredPlugin, RequiredParser, OptionalImport, Scope>["configuration"]["settings"], parsers: Record<RequiredParser, unknown> & Partial<Record<OptionalImport, unknown>>, defaults: Input<RequiredPlugin, RequiredParser, OptionalImport, Scope>["configuration"]["defaults"], { "*": globalExtension, ...scopeExtensions }?: Input<RequiredPlugin, RequiredParser, OptionalImport, Scope>["configuration"]["extensions"], attachments?: Input<RequiredPlugin, RequiredParser, OptionalImport, Scope>["configuration"]["attachments"]);
40
+ ]>, optionalScopes: readonly Scope[], imports: Input<RequiredPlugin, RequiredParser, Scope, OptionalScope>["imports"], settings: Input<RequiredPlugin, RequiredParser, Scope, OptionalScope>["configuration"]["settings"], defaults: Input<RequiredPlugin, RequiredParser, Scope, OptionalScope>["configuration"]["defaults"], { "*": globalExtension, ...scopeExtensions }?: Input<RequiredPlugin, RequiredParser, Scope, OptionalScope>["configuration"]["extensions"], attachments?: Input<RequiredPlugin, RequiredParser, Scope, OptionalScope>["configuration"]["attachments"]);
35
41
  get globals(): readonly [
42
+ {
43
+ name: "linted/*/plugins/";
44
+ plugins: Record<RequiredPlugin, unknown> & {
45
+ svelte?: unknown;
46
+ };
47
+ },
36
48
  {
37
49
  name: "linted/*/settings/";
38
50
  linterOptions: {
39
51
  noInlineConfig: boolean;
40
- reportUnusedDisableDirectives: "error" | "warn" | "off";
52
+ reportUnusedDisableDirectives: "off" | "warn" | "error";
41
53
  };
42
54
  languageOptions: {
43
55
  sourceType: "module" | "script";
@@ -59,9 +71,9 @@ export declare class Factory<RequiredPlugin extends string, RequiredParser exten
59
71
  processor?: string;
60
72
  languageOptions?: {
61
73
  parserOptions?: {
62
- parser?: (Record<RequiredParser, unknown> & Partial<Record<OptionalImport, unknown>>)[RequiredParser | OptionalImport];
74
+ parser?: (Record<RequiredParser, unknown> & Partial<Record<OptionalScope, unknown>>)[RequiredParser | OptionalScope];
63
75
  };
64
- parser?: (Record<RequiredParser, unknown> & Partial<Record<OptionalImport, unknown>>)[RequiredParser | OptionalImport];
76
+ parser?: (Record<RequiredParser, unknown> & Partial<Record<OptionalScope, unknown>>)[RequiredParser | OptionalScope];
65
77
  };
66
78
  name: `linted/${string}/`;
67
79
  files: Record<Scope, string[]>[Scope];
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,qBAAa,OAAO,CAClB,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM,EAC7B,cAAc,SA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.js CHANGED
@@ -1,12 +1,11 @@
1
1
  export class Factory {
2
2
  settings;
3
- parsers;
4
3
  attachments;
5
- global;
4
+ globalConfigs;
6
5
  scopes;
7
- constructor(optionalScopes, tree, settings, parsers, defaults, { "*": globalExtension = {}, ...scopeExtensions } = {}, attachments = []) {
6
+ parsers;
7
+ constructor(tree, optionalScopes, imports, settings, defaults, { "*": globalExtension = {}, ...scopeExtensions } = {}, attachments = []) {
8
8
  this.settings = settings;
9
- this.parsers = parsers;
10
9
  this.attachments = attachments;
11
10
  const { noInlineConfig = settings
12
11
  .global
@@ -16,8 +15,19 @@ export class Factory {
16
15
  .global
17
16
  .sourceType, ecmaVersion = settings
18
17
  .global
19
- .ecmaVersion, } = globalExtension, { ignores = [], override = false, } = globalExtension;
20
- this.global = {
18
+ .ecmaVersion, } = globalExtension;
19
+ this.globalConfigs = {
20
+ plugins: {
21
+ name: "linted/*/plugins/",
22
+ plugins: {
23
+ ...imports.plugins,
24
+ ..."svelte" in scopeExtensions && "plugin" in scopeExtensions.svelte
25
+ ? {
26
+ svelte: scopeExtensions.svelte.plugin,
27
+ }
28
+ : {},
29
+ },
30
+ },
21
31
  settings: {
22
32
  name: "linted/*/settings/",
23
33
  linterOptions: {
@@ -32,45 +42,49 @@ export class Factory {
32
42
  ignores: {
33
43
  name: "linted/*/ignores/",
34
44
  ignores: [
35
- ...override
45
+ ...globalExtension.override === true
36
46
  ? []
37
- : defaults
38
- .ignores["*"],
39
- ...ignores,
47
+ : defaults.ignores["*"],
48
+ ...globalExtension.ignores ?? [],
40
49
  ],
41
50
  },
42
51
  };
43
52
  this.scopes = {
44
- files: defaults
45
- .files,
46
- ignores: defaults
47
- .ignores,
48
- rules: defaults
49
- .rules,
53
+ files: defaults.files,
54
+ ignores: defaults.ignores,
55
+ rules: defaults.rules,
56
+ };
57
+ this.parsers = {
58
+ ...imports.parsers,
59
+ ...("svelte" in scopeExtensions && "parser" in scopeExtensions.svelte
60
+ ? {
61
+ svelte: scopeExtensions.svelte.parser,
62
+ }
63
+ : {}),
50
64
  };
51
65
  for (const scope in scopeExtensions) {
52
- const { [scope]: { files: userFiles = [], ignores: userIgnores = [], rules: userRules = null, } = {}, } = scopeExtensions;
66
+ const { [scope]: { files = [], ignores = [], rules = null, } = {}, } = scopeExtensions;
53
67
  this
54
68
  .scopes
55
69
  .files[scope]
56
- .push(...userFiles);
70
+ .push(...files);
57
71
  this
58
72
  .scopes
59
73
  .ignores[scope]
60
- .push(...userIgnores);
61
- if (userRules !== null)
74
+ .push(...ignores);
75
+ if (rules !== null)
62
76
  this
63
77
  .scopes
64
78
  .rules[scope]
65
79
  .push({
66
80
  id: scope + "/override",
67
- rules: userRules,
81
+ rules,
68
82
  });
69
83
  }
70
84
  const OptionalScopes = new Set(optionalScopes);
71
85
  for (const [scope, parents] of tree)
72
86
  if (!OptionalScopes.has(scope)
73
- || scope in parsers)
87
+ || scope in this.parsers)
74
88
  for (const parent of parents) {
75
89
  this
76
90
  .scopes
@@ -88,8 +102,9 @@ export class Factory {
88
102
  }
89
103
  get globals() {
90
104
  return [
91
- this.global.settings,
92
- this.global.ignores,
105
+ this.globalConfigs.plugins,
106
+ this.globalConfigs.settings,
107
+ this.globalConfigs.ignores,
93
108
  ];
94
109
  }
95
110
  scope(scope) {
@@ -1 +1 @@
1
- {"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,OAAO;IAiBC;IAMV;IAwBS;IAzCX,MAAM,CAAC;IACP,MAAM,CAAC;IAEd,YACE,cAAgC,EAChC,IAKC,EACgB,QAKa,EACvB,OAQN,EACD,QAK8B,EAC9B,EACE,GAAG,EAAE,eAAe,GAAG,EAAE,EACzB,GAAG,eAAe,KAMe,EAAE,EACrB,cAKoB,EAAE;QAnCrB,aAAQ,GAAR,QAAQ,CAKK;QACvB,YAAO,GAAP,OAAO,CAQb;QAgBe,gBAAW,GAAX,WAAW,CAKW;QAEtC,MAAM,EACJ,cAAc,GAAG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IACZ,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Input } from "./interface/index.js";
2
2
  import type { RequiredPlugin, RequiredParser } from "./scope/index.js";
3
3
  import { scopes, optionalScopes } from "./scope/index.js";
4
- export default function ({ imports: { required: { plugins, parsers, }, optional, }, configuration: { settings, defaults, extensions, attachments, }, }: Input<RequiredPlugin, RequiredParser, (typeof optionalScopes[number]), (typeof scopes[number])>): unknown[];
4
+ export default function ({ imports, configuration: { settings, defaults, extensions, attachments, }, }: Input<RequiredPlugin, RequiredParser, (typeof scopes[number]), (typeof optionalScopes[number])>): unknown[];
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EAEN,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,MAAM,EACN,cAAc,EAEf,MAAM,SAAS,CAAC;AAGjB,MAAM,CAAC,OAAO,WACZ,EACE,OAAO,EAAE,EACP,QAAQ,EAAE,EACR,OAAO,EACP,OAAO,GACR,EACD,QAAa,GACd,EACD,aAAa,EAAE,EACb,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,WAAW,GACZ,GACF,EAAE,KAAK,CACN,cAAc,EACd,cAAc,EACd,CAAC,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,EAC/B,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CACxB,aAmDF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EAEN,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,MAAM,EACN,cAAc,EAEf,MAAM,SAAS,CAAC;AAGjB,MAAM,CAAC,OAAO,WACZ,EACE,OAAO,EACP,aAAa,EAAE,EACb,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,WAAW,GACZ,GACF,EAAE,KAAK,CACN,cAAc,EACd,cAAc,EACd,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EACvB,CAAC,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,CAChC,aAgCF"}
package/dist/index.js CHANGED
@@ -1,30 +1,11 @@
1
1
  import { scopes, optionalScopes, tree, } from "./scope/index.js";
2
2
  import { Factory } from "./factory.js";
3
- export default function ({ imports: { required: { plugins, parsers, }, optional = {}, }, configuration: { settings, defaults, extensions, attachments, }, }) {
3
+ export default function ({ imports, configuration: { settings, defaults, extensions, attachments, }, }) {
4
4
  try {
5
- const factory = new Factory(optionalScopes, tree, settings, {
6
- ...parsers,
7
- ..."svelte" in optional
8
- ? {
9
- svelte: optional.svelte.parser,
10
- }
11
- : {},
12
- }, defaults, extensions, attachments);
5
+ const factory = new Factory(tree, optionalScopes, imports, settings, defaults, extensions, attachments);
13
6
  return [
14
- {
15
- name: "linted/*/plugins/",
16
- plugins: {
17
- ...plugins,
18
- ..."svelte" in optional
19
- ? {
20
- svelte: optional.svelte.plugin,
21
- }
22
- : {},
23
- },
24
- },
25
7
  ...factory.globals,
26
- ...scopes
27
- .flatMap(scope => factory.scope(scope)),
8
+ ...scopes.flatMap(scope => factory.scope(scope)),
28
9
  ...factory.attachments,
29
10
  ];
30
11
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,MAAM,EACN,cAAc,EACd,IAAI,GACL,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,WACZ,EACE,OAAO,EAAE,EACP,QAAQ,EAAE,EACR,OAAO,EACP,OAA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,GAMF;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,OAAO,CAMzB,IAAI,EACJ,cAAc,EACd,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,WAAW,CACZ,CAAC;QAEF,OAAO;YACL,GAAG,OAAO,CAAC,OAAO;YAClB,GAAG,MAAM,CAAC,OAAO,CACf,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAC9B;YACD,GAAG,OAAO,CAAC,WAAW;SACO,CAAC;IAClC,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,eAAe,EACf,EAAE,KAAK,EAAE,CAAC,EAAE,CACb,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- export type State = "error" | "warn" | "off";
1
+ export type State = 0 | 1 | 2 | "off" | "warn" | "error";
2
2
  export type Rules = Record<string, State | readonly [
3
3
  State,
4
4
  ...unknown[]
@@ -1 +1 @@
1
- {"version":3,"file":"rule.d.ts","sourceRoot":"","sources":["../../../src/interface/config/rule.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GACb,OAAO,GACP,MAAM,GACN,KAAK,CAAC;AACV,MAAM,MAAM,KAAK,GAAG,MAAM,CACxB,MAAM,EACJ,KAAK,GACL,SAAS;IACT,KAAK;IACL,GAAG,OAAO,EAAE;CACb,CACF,CAAC"}
1
+ {"version":3,"file":"rule.d.ts","sourceRoot":"","sources":["../../../src/interface/config/rule.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GACb,CAAC,GACD,CAAC,GACD,CAAC,GACD,KAAK,GACL,MAAM,GACN,OAAO,CAAC;AACZ,MAAM,MAAM,KAAK,GAAG,MAAM,CACxB,MAAM,EACJ,KAAK,GACL,SAAS;IACT,KAAK;IACL,GAAG,OAAO,EAAE;CACb,CACF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { IConfig } from "../../config/index.js";
2
- export type Extensions<Scope extends string> = {
2
+ export type Extensions<Scope extends string, OptionalScope extends Scope> = {
3
3
  "*"?: Partial<IConfig["linterOptions"] & IConfig["languageOptions"]> & {
4
4
  ignores?: string[];
5
5
  override?: boolean;
@@ -8,5 +8,8 @@ export type Extensions<Scope extends string> = {
8
8
  files?: string[];
9
9
  ignores?: string[];
10
10
  rules?: IConfig["rules"];
11
+ }>> & Partial<Record<OptionalScope, {
12
+ plugin: unknown;
13
+ parser: unknown;
11
14
  }>>;
12
15
  //# sourceMappingURL=extensions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/configuration/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,UAAU,CACpB,KAAK,SAAS,MAAM,IAElB;IACF,GAAG,CAAC,EAAE,OAAO,CACT,OAAO,CAAC,eAAe,CAAC,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAC7B,GAAG;QACF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH,GACC,OAAO,CACP,MAAM,CACJ,KAAK,EACL;IACE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1B,CACF,CACF,CAAC"}
1
+ {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/configuration/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,UAAU,CACpB,KAAK,SAAS,MAAM,EACpB,aAAa,SAAS,KAAK,IAEzB;IACF,GAAG,CAAC,EAAE,OAAO,CACT,OAAO,CAAC,eAAe,CAAC,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAC7B,GAAG;QACF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH,GACC,OAAO,CACP,MAAM,CACJ,KAAK,EACL;IACE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1B,CACF,CACF,GACC,OAAO,CACP,MAAM,CACJ,aAAa,EACb;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB,CACF,CACF,CAAC"}
@@ -2,10 +2,10 @@ import type { Settings } from "./settings.js";
2
2
  import type { Defaults } from "./defaults.js";
3
3
  import type { Extensions } from "./extensions.js";
4
4
  import type { IAttachment } from "./attachment.js";
5
- export interface Configuration<Scope extends string, Parser extends string> {
5
+ export interface Configuration<Parser extends Scope, Scope extends string, OptionalScope extends Scope> {
6
6
  settings: Settings<Scope, Parser>;
7
7
  defaults: Defaults<Scope>;
8
- extensions: Extensions<Scope>;
8
+ extensions: Extensions<Scope, OptionalScope>;
9
9
  attachments: readonly IAttachment[];
10
10
  }
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/configuration/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,aAAa,CAC5B,KAAK,SAAS,MAAM,EACpB,MAAM,SAAS,MAAM;IAErB,QAAQ,EAAE,QAAQ,CAChB,KAAK,EACL,MAAM,CACP,CAAC;IACF,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1B,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC9B,WAAW,EAAE,SAAS,WAAW,EAAE,CAAC;CACrC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/configuration/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,aAAa,CAC5B,MAAM,SAAS,KAAK,EACpB,KAAK,SAAS,MAAM,EACpB,aAAa,SAAS,KAAK;IAE3B,QAAQ,EAAE,QAAQ,CAChB,KAAK,EACL,MAAM,CACP,CAAC;IACF,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1B,UAAU,EAAE,UAAU,CACpB,KAAK,EACL,aAAa,CACd,CAAC;IACF,WAAW,EAAE,SAAS,WAAW,EAAE,CAAC;CACrC"}
@@ -1,6 +1,6 @@
1
1
  import type { IConfig } from "../../config/index.js";
2
2
  import type { ScopeManifest } from "./manifest/index.js";
3
- export interface Settings<Scope extends string, Parser extends string> {
3
+ export interface Settings<Scope extends string, Parser extends Scope> {
4
4
  global: IConfig["linterOptions"] & IConfig["languageOptions"];
5
5
  registry: Record<Scope, ScopeManifest<Parser>>;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/configuration/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,QAAQ,CACvB,KAAK,SAAS,MAAM,EACpB,MAAM,SAAS,MAAM;IAErB,MAAM,EACF,OAAO,CAAC,eAAe,CAAC,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAC7B;IACD,QAAQ,EAAE,MAAM,CACd,KAAK,EACL,aAAa,CACX,MAAM,CACP,CACF,CAAC;CACH"}
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/configuration/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,QAAQ,CACvB,KAAK,SAAS,MAAM,EACpB,MAAM,SAAS,KAAK;IAEpB,MAAM,EACF,OAAO,CAAC,eAAe,CAAC,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAC7B;IACD,QAAQ,EAAE,MAAM,CACd,KAAK,EACL,aAAa,CACX,MAAM,CACP,CACF,CAAC;CACH"}
@@ -0,0 +1,5 @@
1
+ export interface Imports<RequiredPlugin extends string, RequiredParser extends string> {
2
+ plugins: Record<RequiredPlugin, unknown>;
3
+ parsers: Record<RequiredParser, unknown>;
4
+ }
5
+ //# sourceMappingURL=imports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../../src/interface/input/imports.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO,CACtB,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM;IAE7B,OAAO,EAAE,MAAM,CACb,cAAc,EACd,OAAO,CACR,CAAC;IACF,OAAO,EAAE,MAAM,CACb,cAAc,EACd,OAAO,CACR,CAAC;CACH"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imports.js","sourceRoot":"","sources":["../../../src/interface/input/imports.ts"],"names":[],"mappings":""}
@@ -1,7 +1,7 @@
1
- import type { Imports } from "./imports/index.js";
1
+ import type { Imports } from "./imports.js";
2
2
  import type { Configuration } from "./configuration/index.js";
3
- export interface Input<RequiredPlugin extends string, RequiredParser extends string, OptionalImport extends string, Scope extends string> {
4
- imports: Imports<RequiredPlugin, RequiredParser, OptionalImport>;
5
- configuration: Configuration<Scope, (RequiredParser | OptionalImport)>;
3
+ export interface Input<RequiredPlugin extends string, RequiredParser extends Scope, Scope extends string, OptionalScope extends Scope> {
4
+ imports: Imports<RequiredPlugin, RequiredParser>;
5
+ configuration: Configuration<(RequiredParser | OptionalScope), Scope, OptionalScope>;
6
6
  }
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,KAAK,CACpB,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM,EAC7B,KAAK,SAAS,MAAM;IAEpB,OAAO,EAAE,OAAO,CACd,cAAc,EACd,cAAc,EACd,cAAc,CACf,CAAC;IACF,aAAa,EAAE,aAAa,CAC1B,KAAK,EACL,CACI,cAAc,GACd,cAAc,CACjB,CACF,CAAC;CACH"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,KAAK,CACpB,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,KAAK,EAC5B,KAAK,SAAS,MAAM,EACpB,aAAa,SAAS,KAAK;IAE3B,OAAO,EAAE,OAAO,CACd,cAAc,EACd,cAAc,CACf,CAAC;IACF,aAAa,EAAE,aAAa,CAC1B,CACI,cAAc,GACd,aAAa,CAChB,EACD,KAAK,EACL,aAAa,CACd,CAAC;CACH"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "$schema": "https://json.schemastore.org/package",
4
4
  "$help": "https://docs.npmjs.com/cli/configuring-npm/package-json",
5
5
  "name": "@eslinted/core",
6
- "version": "23.1.4",
6
+ "version": "24.1.0",
7
7
  "repository": "github:jimmy-zhening-luo/linted-core",
8
8
  "description": "Internal core for npm package `linted`, responsible for producing an array of fully-formed ESLint configurations according to `linted` spec.",
9
9
  "keywords": [],
@@ -1,29 +1,27 @@
1
1
  const
2
- ERROR = "error",
3
- OFF = "off",
2
+ ERROR = 2,
3
+ OFF = 0,
4
4
  Plugin = "MOCK_PLUGIN",
5
5
  Parser = (scope: string) => `MOCK_PARSER:${scope}`;
6
6
 
7
7
  export const TEST_INPUT = {
8
8
  imports: {
9
- required: {
10
- plugins: {
11
- "@stylistic": Plugin,
12
- "@typescript-eslint": Plugin,
13
- mocha: Plugin,
14
- "chai-friendly": Plugin,
15
- "chai-expect": Plugin,
16
- "@html-eslint": Plugin,
17
- css: Plugin,
18
- json: Plugin,
19
- jsonc: Plugin,
20
- yml: Plugin,
21
- },
22
- parsers: {
23
- ts: Parser("TS"),
24
- html: Parser("HTML"),
25
- yml: Parser("YML"),
26
- },
9
+ plugins: {
10
+ "@stylistic": Plugin,
11
+ "@typescript-eslint": Plugin,
12
+ mocha: Plugin,
13
+ "chai-friendly": Plugin,
14
+ "chai-expect": Plugin,
15
+ "@html-eslint": Plugin,
16
+ css: Plugin,
17
+ json: Plugin,
18
+ jsonc: Plugin,
19
+ yml: Plugin,
20
+ },
21
+ parsers: {
22
+ ts: Parser("TS"),
23
+ html: Parser("HTML"),
24
+ yml: Parser("YML"),
27
25
  },
28
26
  },
29
27
  configuration: {
package/src/factory.ts CHANGED
@@ -2,41 +2,39 @@ import type { Input } from "./interface";
2
2
 
3
3
  export class Factory<
4
4
  RequiredPlugin extends string,
5
- RequiredParser extends string,
6
- OptionalImport extends string,
5
+ RequiredParser extends Scope,
7
6
  Scope extends string,
7
+ OptionalScope extends Scope,
8
8
  > {
9
- public global;
9
+ public globalConfigs;
10
10
  public scopes;
11
+ public parsers;
11
12
 
12
13
  constructor(
13
- optionalScopes: readonly Scope[],
14
14
  tree: Array<
15
15
  readonly [
16
16
  Scope,
17
17
  readonly Scope[],
18
18
  ]
19
19
  >,
20
+ optionalScopes: readonly Scope[],
21
+ imports: Input<
22
+ RequiredPlugin,
23
+ RequiredParser,
24
+ Scope,
25
+ OptionalScope
26
+ >["imports"],
20
27
  private readonly settings: Input<
21
28
  RequiredPlugin,
22
29
  RequiredParser,
23
- OptionalImport,
24
- Scope
30
+ Scope,
31
+ OptionalScope
25
32
  >["configuration"]["settings"],
26
- public parsers: Record<
27
- RequiredParser,
28
- unknown
29
- > & Partial<
30
- Record<
31
- OptionalImport,
32
- unknown
33
- >
34
- >,
35
33
  defaults: Input<
36
34
  RequiredPlugin,
37
35
  RequiredParser,
38
- OptionalImport,
39
- Scope
36
+ Scope,
37
+ OptionalScope
40
38
  >["configuration"]["defaults"],
41
39
  {
42
40
  "*": globalExtension = {},
@@ -44,14 +42,14 @@ export class Factory<
44
42
  }: Input<
45
43
  RequiredPlugin,
46
44
  RequiredParser,
47
- OptionalImport,
48
- Scope
45
+ Scope,
46
+ OptionalScope
49
47
  >["configuration"]["extensions"] = {},
50
48
  public readonly attachments: Input<
51
49
  RequiredPlugin,
52
50
  RequiredParser,
53
- OptionalImport,
54
- Scope
51
+ Scope,
52
+ OptionalScope
55
53
  >["configuration"]["attachments"] = [],
56
54
  ) {
57
55
  const {
@@ -67,13 +65,20 @@ export class Factory<
67
65
  ecmaVersion = settings
68
66
  .global
69
67
  .ecmaVersion,
70
- } = globalExtension,
71
- {
72
- ignores = [],
73
- override = false,
74
68
  } = globalExtension;
75
69
 
76
- this.global = {
70
+ this.globalConfigs = {
71
+ plugins: {
72
+ name: "linted/*/plugins/" as const,
73
+ plugins: {
74
+ ...imports.plugins,
75
+ ..."svelte" in scopeExtensions && "plugin" in (scopeExtensions.svelte as object)
76
+ ? {
77
+ svelte: (scopeExtensions.svelte as { plugin: unknown }).plugin,
78
+ }
79
+ : {},
80
+ },
81
+ },
77
82
  settings: {
78
83
  name: "linted/*/settings/" as const,
79
84
  linterOptions: {
@@ -88,61 +93,68 @@ export class Factory<
88
93
  ignores: {
89
94
  name: "linted/*/ignores/" as const,
90
95
  ignores: [
91
- ...override
96
+ ...globalExtension.override === true
92
97
  ? []
93
- : defaults
94
- .ignores["*"],
95
- ...ignores,
98
+ : defaults.ignores["*"],
99
+ ...globalExtension.ignores ?? [],
96
100
  ],
97
101
  },
98
102
  };
99
103
  this.scopes = {
100
- files: defaults
101
- .files,
102
- ignores: defaults
103
- .ignores,
104
- rules: defaults
105
- .rules,
104
+ files: defaults.files,
105
+ ignores: defaults.ignores,
106
+ rules: defaults.rules,
107
+ };
108
+ this.parsers = {
109
+ ...imports.parsers,
110
+ ...("svelte" in scopeExtensions && "parser" in (scopeExtensions.svelte as object)
111
+ ? {
112
+ svelte: (scopeExtensions.svelte as { parser: unknown }).parser,
113
+ }
114
+ : {}) as unknown as Partial<
115
+ Record<
116
+ OptionalScope,
117
+ unknown
118
+ >
119
+ >,
106
120
  };
107
121
 
108
122
  for (const scope in scopeExtensions) {
109
123
  const {
110
124
  [scope as keyof typeof scopeExtensions]: {
111
- files: userFiles = [],
112
- ignores: userIgnores = [],
113
- rules: userRules = null,
125
+ files = [],
126
+ ignores = [],
127
+ rules = null,
114
128
  } = {},
115
129
  } = scopeExtensions;
116
130
 
117
131
  this
118
132
  .scopes
119
133
  .files[scope as keyof typeof scopeExtensions]
120
- .push(...userFiles);
134
+ .push(...files);
121
135
  this
122
136
  .scopes
123
137
  .ignores[scope as keyof typeof scopeExtensions]
124
- .push(...userIgnores);
138
+ .push(...ignores);
125
139
 
126
- if (userRules !== null)
140
+ if (rules !== null)
127
141
  this
128
142
  .scopes
129
143
  .rules[scope as keyof typeof scopeExtensions]
130
144
  .push(
131
145
  {
132
146
  id: scope + "/override",
133
- rules: userRules,
147
+ rules,
134
148
  },
135
149
  );
136
150
  }
137
151
 
138
- const OptionalScopes = new Set<Scope>(
139
- optionalScopes,
140
- );
152
+ const OptionalScopes = new Set<Scope>(optionalScopes);
141
153
 
142
154
  for (const [scope, parents] of tree)
143
155
  if (
144
156
  !OptionalScopes.has(scope)
145
- || scope in parsers
157
+ || scope in this.parsers
146
158
  )
147
159
  for (const parent of parents) {
148
160
  this
@@ -166,8 +178,9 @@ export class Factory<
166
178
 
167
179
  public get globals() {
168
180
  return [
169
- this.global.settings,
170
- this.global.ignores,
181
+ this.globalConfigs.plugins,
182
+ this.globalConfigs.settings,
183
+ this.globalConfigs.ignores,
171
184
  ] as const;
172
185
  }
173
186
 
package/src/index.ts CHANGED
@@ -15,13 +15,7 @@ import { Factory } from "./factory";
15
15
 
16
16
  export default function (
17
17
  {
18
- imports: {
19
- required: {
20
- plugins,
21
- parsers,
22
- },
23
- optional = {},
24
- },
18
+ imports,
25
19
  configuration: {
26
20
  settings,
27
21
  defaults,
@@ -31,50 +25,31 @@ export default function (
31
25
  }: Input<
32
26
  RequiredPlugin,
33
27
  RequiredParser,
34
- (typeof optionalScopes[number]),
35
- (typeof scopes[number])
28
+ (typeof scopes[number]),
29
+ (typeof optionalScopes[number])
36
30
  >,
37
31
  ) {
38
32
  try {
39
33
  const factory = new Factory<
40
34
  RequiredPlugin,
41
35
  RequiredParser,
42
- (typeof optionalScopes[number]),
43
- (typeof scopes[number])
36
+ (typeof scopes[number]),
37
+ (typeof optionalScopes[number])
44
38
  >(
45
- optionalScopes,
46
39
  tree,
40
+ optionalScopes,
41
+ imports,
47
42
  settings,
48
- {
49
- ...parsers,
50
- ..."svelte" in optional
51
- ? {
52
- svelte: optional.svelte.parser,
53
- }
54
- : {},
55
- },
56
43
  defaults,
57
44
  extensions,
58
45
  attachments,
59
46
  );
60
47
 
61
48
  return [
62
- {
63
- name: "linted/*/plugins/",
64
- plugins: {
65
- ...plugins,
66
- ..."svelte" in optional
67
- ? {
68
- svelte: optional.svelte.plugin,
69
- }
70
- : {},
71
- },
72
- },
73
49
  ...factory.globals,
74
- ...scopes
75
- .flatMap(
76
- scope => factory.scope(scope),
77
- ),
50
+ ...scopes.flatMap(
51
+ scope => factory.scope(scope),
52
+ ),
78
53
  ...factory.attachments,
79
54
  ] satisfies Output as unknown[];
80
55
  }
@@ -1,7 +1,10 @@
1
1
  export type State
2
- = | "error"
2
+ = | 0
3
+ | 1
4
+ | 2
5
+ | "off"
3
6
  | "warn"
4
- | "off";
7
+ | "error";
5
8
  export type Rules = Record<
6
9
  string,
7
10
  | State
@@ -2,6 +2,7 @@ import type { IConfig } from "../../config";
2
2
 
3
3
  export type Extensions<
4
4
  Scope extends string,
5
+ OptionalScope extends Scope,
5
6
  >
6
7
  = & {
7
8
  "*"?: Partial<
@@ -21,4 +22,13 @@ export type Extensions<
21
22
  rules?: IConfig["rules"];
22
23
  }
23
24
  >
25
+ >
26
+ & Partial<
27
+ Record<
28
+ OptionalScope,
29
+ {
30
+ plugin: unknown;
31
+ parser: unknown;
32
+ }
33
+ >
24
34
  >;
@@ -4,14 +4,18 @@ import type { Extensions } from "./extensions";
4
4
  import type { IAttachment } from "./attachment";
5
5
 
6
6
  export interface Configuration<
7
+ Parser extends Scope,
7
8
  Scope extends string,
8
- Parser extends string,
9
+ OptionalScope extends Scope,
9
10
  > {
10
11
  settings: Settings<
11
12
  Scope,
12
13
  Parser
13
14
  >;
14
15
  defaults: Defaults<Scope>;
15
- extensions: Extensions<Scope>;
16
+ extensions: Extensions<
17
+ Scope,
18
+ OptionalScope
19
+ >;
16
20
  attachments: readonly IAttachment[];
17
21
  }
@@ -3,7 +3,7 @@ import type { ScopeManifest } from "./manifest";
3
3
 
4
4
  export interface Settings<
5
5
  Scope extends string,
6
- Parser extends string,
6
+ Parser extends Scope,
7
7
  > {
8
8
  global:
9
9
  & IConfig["linterOptions"]
@@ -1,4 +1,4 @@
1
- export interface RequiredImports<
1
+ export interface Imports<
2
2
  RequiredPlugin extends string,
3
3
  RequiredParser extends string,
4
4
  > {
@@ -3,20 +3,20 @@ import type { Configuration } from "./configuration";
3
3
 
4
4
  export interface Input<
5
5
  RequiredPlugin extends string,
6
- RequiredParser extends string,
7
- OptionalImport extends string,
6
+ RequiredParser extends Scope,
8
7
  Scope extends string,
8
+ OptionalScope extends Scope,
9
9
  > {
10
10
  imports: Imports<
11
11
  RequiredPlugin,
12
- RequiredParser,
13
- OptionalImport
12
+ RequiredParser
14
13
  >;
15
14
  configuration: Configuration<
16
- Scope,
17
15
  (
18
16
  | RequiredParser
19
- | OptionalImport
20
- )
17
+ | OptionalScope
18
+ ),
19
+ Scope,
20
+ OptionalScope
21
21
  >;
22
22
  }
@@ -1,7 +0,0 @@
1
- import type { RequiredImports } from "./required.js";
2
- import type { OptionalImports } from "./optional.js";
3
- export interface Imports<RequiredPlugin extends string, RequiredParser extends string, OptionalImport extends string> {
4
- required: RequiredImports<RequiredPlugin, RequiredParser>;
5
- optional?: OptionalImports<OptionalImport>;
6
- }
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/imports/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,OAAO,CACtB,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM;IAE7B,QAAQ,EAAE,eAAe,CACvB,cAAc,EACd,cAAc,CACf,CAAC;IACF,QAAQ,CAAC,EAAE,eAAe,CACxB,cAAc,CACf,CAAC;CACH"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interface/input/imports/index.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- export type OptionalImports<OptionalImport extends string> = Partial<Record<OptionalImport, {
2
- plugin: unknown;
3
- parser: unknown;
4
- }>>;
5
- //# sourceMappingURL=optional.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/imports/optional.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,CACzB,cAAc,SAAS,MAAM,IAC3B,OAAO,CACT,MAAM,CACJ,cAAc,EACd;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB,CACF,CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=optional.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional.js","sourceRoot":"","sources":["../../../../src/interface/input/imports/optional.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- export interface RequiredImports<RequiredPlugin extends string, RequiredParser extends string> {
2
- plugins: Record<RequiredPlugin, unknown>;
3
- parsers: Record<RequiredParser, unknown>;
4
- }
5
- //# sourceMappingURL=required.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required.d.ts","sourceRoot":"","sources":["../../../../src/interface/input/imports/required.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe,CAC9B,cAAc,SAAS,MAAM,EAC7B,cAAc,SAAS,MAAM;IAE7B,OAAO,EAAE,MAAM,CACb,cAAc,EACd,OAAO,CACR,CAAC;IACF,OAAO,EAAE,MAAM,CACb,cAAc,EACd,OAAO,CACR,CAAC;CACH"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=required.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required.js","sourceRoot":"","sources":["../../../../src/interface/input/imports/required.ts"],"names":[],"mappings":""}
@@ -1,16 +0,0 @@
1
- import type { RequiredImports } from "./required";
2
- import type { OptionalImports } from "./optional";
3
-
4
- export interface Imports<
5
- RequiredPlugin extends string,
6
- RequiredParser extends string,
7
- OptionalImport extends string,
8
- > {
9
- required: RequiredImports<
10
- RequiredPlugin,
11
- RequiredParser
12
- >;
13
- optional?: OptionalImports<
14
- OptionalImport
15
- >;
16
- }
@@ -1,11 +0,0 @@
1
- export type OptionalImports<
2
- OptionalImport extends string,
3
- > = Partial<
4
- Record<
5
- OptionalImport,
6
- {
7
- plugin: unknown;
8
- parser: unknown;
9
- }
10
- >
11
- >;