@eslinted/core 13.0.0 → 13.1.0-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/factory/factory.d.ts +175 -0
- package/dist/factory/factory.d.ts.map +1 -0
- package/dist/factory/factory.js +42 -0
- package/dist/factory/factory.js.map +1 -0
- package/dist/factory/index.d.ts +2 -3
- package/dist/factory/index.d.ts.map +1 -1
- package/dist/factory/index.js +2 -3
- package/dist/factory/index.js.map +1 -1
- package/dist/factory/ruleset.d.ts +3 -3
- package/dist/factory/ruleset.d.ts.map +1 -1
- package/dist/factory/ruleset.js +3 -3
- package/dist/factory/ruleset.js.map +1 -1
- package/dist/factory/{options → settings}/index.d.ts +1 -2
- package/dist/factory/settings/index.d.ts.map +1 -0
- package/dist/factory/settings/index.js.map +1 -0
- package/dist/factory/{options → settings}/scopes/html.d.ts +2 -2
- package/dist/factory/settings/scopes/html.d.ts.map +1 -0
- package/dist/factory/{options → settings}/scopes/html.js +2 -2
- package/dist/factory/settings/scopes/html.js.map +1 -0
- package/dist/factory/{options → settings}/scopes/js.d.ts +2 -2
- package/dist/factory/settings/scopes/js.d.ts.map +1 -0
- package/dist/factory/{options → settings}/scopes/js.js +2 -2
- package/dist/factory/settings/scopes/js.js.map +1 -0
- package/dist/factory/{options → settings}/scopes/json.d.ts +2 -2
- package/dist/factory/settings/scopes/json.d.ts.map +1 -0
- package/dist/factory/{options → settings}/scopes/json.js +2 -2
- package/dist/factory/settings/scopes/json.js.map +1 -0
- package/dist/factory/{options → settings}/scopes/jsonc.d.ts +2 -2
- package/dist/factory/settings/scopes/jsonc.d.ts.map +1 -0
- package/dist/factory/{options → settings}/scopes/jsonc.js +2 -2
- package/dist/factory/settings/scopes/jsonc.js.map +1 -0
- package/dist/factory/{options → settings}/scopes/mocha.d.ts +3 -3
- package/dist/factory/settings/scopes/mocha.d.ts.map +1 -0
- package/dist/factory/{options → settings}/scopes/mocha.js +5 -4
- package/dist/factory/settings/scopes/mocha.js.map +1 -0
- package/dist/factory/{options → settings}/scopes/svelte.d.ts +7 -7
- package/dist/factory/settings/scopes/svelte.d.ts.map +1 -0
- package/dist/factory/{options → settings}/scopes/svelte.js +2 -2
- package/dist/factory/settings/scopes/svelte.js.map +1 -0
- package/dist/factory/{options → settings}/scopes/ts.d.ts +5 -5
- package/dist/factory/settings/scopes/ts.d.ts.map +1 -0
- package/dist/factory/{options → settings}/scopes/ts.js +2 -2
- package/dist/factory/settings/scopes/ts.js.map +1 -0
- package/dist/factory/{options → settings}/scopes/yml.d.ts +2 -2
- package/dist/factory/settings/scopes/yml.d.ts.map +1 -0
- package/dist/factory/{options → settings}/scopes/yml.js +2 -2
- package/dist/factory/settings/scopes/yml.js.map +1 -0
- package/dist/factory/settings/setting.d.ts +48 -0
- package/dist/factory/settings/setting.d.ts.map +1 -0
- package/dist/factory/settings/setting.js +20 -0
- package/dist/factory/settings/setting.js.map +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -21
- package/dist/index.js.map +1 -1
- package/dist/interface/config/index.d.ts +23 -0
- package/dist/interface/config/index.d.ts.map +1 -0
- package/dist/{config → interface/config}/index.js.map +1 -1
- package/dist/interface/config/rule.d.ts +7 -0
- package/dist/interface/config/rule.d.ts.map +1 -0
- package/dist/{config → interface/config}/rule.js.map +1 -1
- package/dist/interface/configs/globals/ignores.d.ts +6 -0
- package/dist/interface/configs/globals/ignores.d.ts.map +1 -0
- package/dist/interface/configs/globals/ignores.js +2 -0
- package/dist/interface/configs/globals/ignores.js.map +1 -0
- package/dist/interface/configs/globals/index.d.ts +5 -0
- package/dist/interface/configs/globals/index.d.ts.map +1 -0
- package/dist/interface/configs/globals/index.js +2 -0
- package/dist/interface/configs/globals/index.js.map +1 -0
- package/dist/interface/configs/globals/only/index.d.ts +2 -0
- package/dist/interface/configs/globals/only/index.d.ts.map +1 -0
- package/dist/interface/configs/globals/only/index.js +2 -0
- package/dist/interface/configs/globals/only/index.js.map +1 -0
- package/dist/interface/configs/globals/plugins.d.ts +6 -0
- package/dist/interface/configs/globals/plugins.d.ts.map +1 -0
- package/dist/interface/configs/globals/plugins.js +2 -0
- package/dist/interface/configs/globals/plugins.js.map +1 -0
- package/dist/interface/configs/globals/settings.d.ts +7 -0
- package/dist/interface/configs/globals/settings.d.ts.map +1 -0
- package/dist/interface/configs/globals/settings.js +2 -0
- package/dist/interface/configs/globals/settings.js.map +1 -0
- package/dist/interface/configs/index.d.ts +3 -0
- package/dist/interface/configs/index.d.ts.map +1 -0
- package/dist/interface/configs/index.js +2 -0
- package/dist/interface/configs/index.js.map +1 -0
- package/dist/interface/configs/scoped.d.ts +7 -0
- package/dist/interface/configs/scoped.d.ts.map +1 -0
- package/dist/interface/configs/scoped.js +2 -0
- package/dist/interface/configs/scoped.js.map +1 -0
- package/dist/interface/imports/index.d.ts +3 -3
- package/dist/interface/imports/index.d.ts.map +1 -1
- package/dist/interface/imports/parsers.d.ts +2 -0
- package/dist/interface/imports/parsers.d.ts.map +1 -0
- package/dist/interface/imports/parsers.js +2 -0
- package/dist/interface/imports/parsers.js.map +1 -0
- package/dist/interface/imports/plugins.d.ts +2 -0
- package/dist/interface/imports/plugins.d.ts.map +1 -0
- package/dist/interface/imports/plugins.js +2 -0
- package/dist/interface/imports/plugins.js.map +1 -0
- package/dist/interface/index.d.ts +2 -1
- package/dist/interface/index.d.ts.map +1 -1
- package/dist/interface/input.d.ts +13 -13
- package/dist/interface/input.d.ts.map +1 -1
- package/dist/interface/output.d.ts +7 -15
- package/dist/interface/output.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/factory/factory.ts +89 -0
- package/src/factory/index.ts +2 -3
- package/src/factory/ruleset.ts +9 -13
- package/src/factory/{options → settings}/index.ts +1 -2
- package/src/factory/settings/scopes/html.ts +16 -0
- package/src/factory/settings/scopes/js.ts +11 -0
- package/src/factory/settings/scopes/json.ts +16 -0
- package/src/factory/settings/scopes/jsonc.ts +16 -0
- package/src/factory/settings/scopes/mocha.ts +29 -0
- package/src/factory/{options → settings}/scopes/svelte.ts +9 -9
- package/src/factory/settings/scopes/ts.ts +28 -0
- package/src/factory/settings/scopes/yml.ts +17 -0
- package/src/factory/settings/setting.ts +63 -0
- package/src/index.ts +26 -75
- package/src/interface/config/index.ts +42 -0
- package/src/interface/config/rule.ts +14 -0
- package/src/interface/configs/globals/ignores.ts +10 -0
- package/src/interface/configs/globals/index.ts +4 -0
- package/src/interface/configs/globals/only/index.ts +4 -0
- package/src/interface/configs/globals/plugins.ts +10 -0
- package/src/interface/configs/globals/settings.ts +13 -0
- package/src/interface/configs/index.ts +2 -0
- package/src/interface/configs/scoped.ts +7 -0
- package/src/interface/imports/index.ts +2 -16
- package/src/interface/imports/parsers.ts +7 -0
- package/src/interface/imports/plugins.ts +9 -0
- package/src/interface/index.ts +2 -1
- package/src/interface/input.ts +15 -19
- package/src/interface/output.ts +7 -22
- package/dist/config/index.d.ts +0 -23
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/rule.d.ts +0 -7
- package/dist/config/rule.d.ts.map +0 -1
- package/dist/factory/global.d.ts +0 -29
- package/dist/factory/global.d.ts.map +0 -1
- package/dist/factory/global.js +0 -41
- package/dist/factory/global.js.map +0 -1
- package/dist/factory/options/index.d.ts.map +0 -1
- package/dist/factory/options/index.js.map +0 -1
- package/dist/factory/options/option.d.ts +0 -3002
- package/dist/factory/options/option.d.ts.map +0 -1
- package/dist/factory/options/option.js +0 -48
- package/dist/factory/options/option.js.map +0 -1
- package/dist/factory/options/proto.d.ts +0 -19
- package/dist/factory/options/proto.d.ts.map +0 -1
- package/dist/factory/options/proto.js +0 -2
- package/dist/factory/options/proto.js.map +0 -1
- package/dist/factory/options/scopes/html.d.ts.map +0 -1
- package/dist/factory/options/scopes/html.js.map +0 -1
- package/dist/factory/options/scopes/js.d.ts.map +0 -1
- package/dist/factory/options/scopes/js.js.map +0 -1
- package/dist/factory/options/scopes/json.d.ts.map +0 -1
- package/dist/factory/options/scopes/json.js.map +0 -1
- package/dist/factory/options/scopes/jsonc.d.ts.map +0 -1
- package/dist/factory/options/scopes/jsonc.js.map +0 -1
- package/dist/factory/options/scopes/mocha.d.ts.map +0 -1
- package/dist/factory/options/scopes/mocha.js.map +0 -1
- package/dist/factory/options/scopes/svelte.d.ts.map +0 -1
- package/dist/factory/options/scopes/svelte.js.map +0 -1
- package/dist/factory/options/scopes/ts.d.ts.map +0 -1
- package/dist/factory/options/scopes/ts.js.map +0 -1
- package/dist/factory/options/scopes/yml.d.ts.map +0 -1
- package/dist/factory/options/scopes/yml.js.map +0 -1
- package/dist/factory/scoped.d.ts +0 -13
- package/dist/factory/scoped.d.ts.map +0 -1
- package/dist/factory/scoped.js +0 -17
- package/dist/factory/scoped.js.map +0 -1
- package/src/config/index.ts +0 -42
- package/src/config/rule.ts +0 -14
- package/src/factory/global.ts +0 -45
- package/src/factory/options/option.ts +0 -98
- package/src/factory/options/proto.ts +0 -46
- package/src/factory/options/scopes/html.ts +0 -16
- package/src/factory/options/scopes/js.ts +0 -11
- package/src/factory/options/scopes/json.ts +0 -16
- package/src/factory/options/scopes/jsonc.ts +0 -16
- package/src/factory/options/scopes/mocha.ts +0 -29
- package/src/factory/options/scopes/ts.ts +0 -28
- package/src/factory/options/scopes/yml.ts +0 -17
- package/src/factory/scoped.ts +0 -17
- /package/dist/factory/{options → settings}/index.js +0 -0
- /package/dist/{config → interface/config}/index.js +0 -0
- /package/dist/{config → interface/config}/rule.js +0 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
import type globals from "globals";
|
2
|
+
import type { Scopes } from "../../index.js";
|
3
|
+
export declare abstract class ScopeSetting<S extends Scopes, ParserOptions extends object | boolean = false, ParserCount extends 0 | 1 | 2 = ParserOptions extends false ? 0 : 1, G extends keyof typeof globals & ("mocha") | false = false, Processor extends object = object, Language extends object = object> {
|
4
|
+
readonly parser: readonly unknown[] & {
|
5
|
+
length: ParserCount;
|
6
|
+
};
|
7
|
+
abstract readonly scope: S;
|
8
|
+
abstract readonly processor: (Processor extends never ? object : Processor extends {
|
9
|
+
readonly processor: infer P;
|
10
|
+
} ? string extends P ? object : {
|
11
|
+
readonly processor: P;
|
12
|
+
} : object);
|
13
|
+
abstract readonly language: (Language extends never ? object : Language extends {
|
14
|
+
readonly language: infer L;
|
15
|
+
} ? string extends L ? object : {
|
16
|
+
readonly language: L;
|
17
|
+
} : object);
|
18
|
+
constructor(parser: readonly unknown[] & {
|
19
|
+
length: ParserCount;
|
20
|
+
});
|
21
|
+
get option(): {
|
22
|
+
readonly languageOptions: (G extends never ? object : G extends boolean ? object : G extends string ? string extends G ? object : {
|
23
|
+
readonly globals: Readonly<Record<string, unknown>>;
|
24
|
+
} : object) & ParserOptions extends never ? object : ParserOptions extends boolean ? ParserOptions extends true ? {
|
25
|
+
readonly parser: unknown;
|
26
|
+
} : object : {
|
27
|
+
readonly parser: unknown;
|
28
|
+
readonly parserOptions: ParserOptions;
|
29
|
+
};
|
30
|
+
} & (Processor extends never ? object : Processor extends {
|
31
|
+
readonly processor: infer P;
|
32
|
+
} ? string extends P ? object : {
|
33
|
+
readonly processor: P;
|
34
|
+
} : object) & (Language extends never ? object : Language extends {
|
35
|
+
readonly language: infer L;
|
36
|
+
} ? string extends L ? object : {
|
37
|
+
readonly language: L;
|
38
|
+
} : object);
|
39
|
+
protected abstract get languageOptions(): (G extends never ? object : G extends boolean ? object : G extends string ? string extends G ? object : {
|
40
|
+
readonly globals: Readonly<Record<string, unknown>>;
|
41
|
+
} : object) & ParserOptions extends never ? object : ParserOptions extends boolean ? ParserOptions extends true ? {
|
42
|
+
readonly parser: unknown;
|
43
|
+
} : object : {
|
44
|
+
readonly parser: unknown;
|
45
|
+
readonly parserOptions: ParserOptions;
|
46
|
+
};
|
47
|
+
}
|
48
|
+
//# sourceMappingURL=setting.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"setting.d.ts","sourceRoot":"","sources":["../../../src/factory/settings/setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,8BAAsB,YAAY,CAChC,CAAC,SAAS,MAAM,EAChB,aAAa,SACX,MAAM,GACN,OAAO,GAAG,KAAK,EACjB,WAAW,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,aAAa,SAAS,KAAK,GAAG,CAAC,GAAG,CAAC,EACnE,CAAC,SAAS,MAAM,OAAO,OAAO,GAAG,CAC7B,OAAO,CACV,GAAG,KAAK,GAAG,KAAK,EACjB,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,QAAQ,SAAS,MAAM,GAAG,MAAM;aAiBJ,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE;IAfhF,kBAAyB,KAAK,EAAE,CAAC,CAAC;IAClC,kBAAyB,SAAS,EAAE,CAAC,SAAS,SAAS,KAAK,GACxD,MAAM,GACN,SAAS,SAAS;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;KAAE,GAC/C,MAAM,SAAS,CAAC,GACd,MAAM,GACN;QAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAA;KAAE,GAC3B,MAAM,CAAC,CAAC;IACd,kBAAyB,QAAQ,EAAE,CAAC,QAAQ,SAAS,KAAK,GACtD,MAAM,GACN,QAAQ,SAAS;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;KAAE,GAC7C,MAAM,SAAS,CAAC,GACd,MAAM,GACN;QAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;KAAE,GAC1B,MAAM,CAAC,CAAC;gBACc,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE;IAEhF,IAAW,MAAM;;8BAqBe,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;6BAMpC,OAAO;;6BAET,OAAO;oCAA0B,aAAa;;;4BA3C7B,MAAM,CAAC;;4BAGrB,CAAC;;2BAIW,MAAM,CAAC;;2BAGpB,CAAC;gBAe7B;IAED,SAAS,CAAC,QAAQ,KAAK,eAAe,IACpC,CAAC,CAAC,SAAS,KAAK,GACZ,MAAM,GACN,CAAC,SAAS,OAAO,GACf,MAAM,GACN,CAAC,SAAS,MAAM,GACd,MAAM,SAAS,CAAC,GACd,MAAM,GACN;QAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;KAAE,GACzD,MAAM,CACb,GAAG,aAAa,SAAS,KAAK,GAC3B,MAAM,GACN,aAAa,SAAS,OAAO,GAC3B,aAAa,SAAS,IAAI,GACxB;QAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;KAAE,GAC5B,MAAM,GACR;QAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAA;KAAE,CAAC;CAC7E"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
export class ScopeSetting {
|
2
|
+
parser;
|
3
|
+
constructor(parser) {
|
4
|
+
this.parser = parser;
|
5
|
+
}
|
6
|
+
get option() {
|
7
|
+
try {
|
8
|
+
const { languageOptions, processor, language } = this;
|
9
|
+
return {
|
10
|
+
languageOptions,
|
11
|
+
...processor,
|
12
|
+
...language,
|
13
|
+
};
|
14
|
+
}
|
15
|
+
catch (e) {
|
16
|
+
throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e });
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
//# sourceMappingURL=setting.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"setting.js","sourceRoot":"","sources":["../../../src/factory/settings/setting.ts"],"names":[],"mappings":"AAGA,MAAM,OAAgB,YAAY;IA2BJ;IAA5B,YAA4B,MAAoD;QAApD,WAAM,GAAN,MAAM,CAA8C;IAAG,CAAC;IAEpF,IAAW,MAAM;QACf,IAAI,CAAC;YACH,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;YAEtD,OAAO;gBACL,eAAe;gBACf,GAAG,SAAS;gBACZ,GAAG,QAAQ;aACH,CAAC;QACb,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,KAAK,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QAAC,CAAC;IACnG,CAAC;CAmBF"}
|
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { Input, Output } from "./interface/index.js";
|
2
2
|
export type { Scopes } from "./scopes.js";
|
3
3
|
export type * from "./interface/index.js";
|
4
|
-
export
|
5
|
-
export default function ({ imports: { plugins, parsers, }, defaults, extensions, }: Input): Output;
|
4
|
+
export default function ({ imports: { plugins, parsers }, defaults, extensions, }: Input): Output;
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
@@ -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,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,mBAAmB,aAAa,CAAC;AACjC,MAAM,CAAC,OAAO,WAAW,EACvB,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAC7B,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,GAAG,MAAM,CAwBhB"}
|
package/dist/index.js
CHANGED
@@ -1,28 +1,22 @@
|
|
1
1
|
import { scopes } from "./scopes.js";
|
2
|
-
import {
|
3
|
-
export default function ({ imports: { plugins, parsers
|
2
|
+
import { Factory, Options } from "./factory/index.js";
|
3
|
+
export default function ({ imports: { plugins, parsers }, defaults, extensions, }) {
|
4
4
|
try {
|
5
|
-
const
|
6
|
-
js: new Options
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
html: new Options
|
15
|
-
.html([parsers.html], ...factory.produce("html")).configs,
|
16
|
-
json: new Options
|
17
|
-
.json([parsers.jsonc], ...factory.produce("json")).configs,
|
18
|
-
jsonc: new Options
|
19
|
-
.jsonc([parsers.jsonc], ...factory.produce("jsonc")).configs,
|
20
|
-
yml: new Options
|
21
|
-
.yml([parsers.yml], ...factory.produce("yml")).configs,
|
5
|
+
const factory = new Factory(defaults, extensions), options = {
|
6
|
+
js: new Options.js([]),
|
7
|
+
ts: new Options.ts([parsers.ts]),
|
8
|
+
svelte: new Options.svelte([parsers.svelte, parsers.ts]),
|
9
|
+
mocha: new Options.mocha([parsers.ts]),
|
10
|
+
html: new Options.html([parsers.html]),
|
11
|
+
json: new Options.json([parsers.jsonc]),
|
12
|
+
jsonc: new Options.jsonc([parsers.jsonc]),
|
13
|
+
yml: new Options.yml([parsers.yml]),
|
22
14
|
};
|
23
15
|
return [
|
24
|
-
|
25
|
-
|
16
|
+
{ name: `linted/*/plugins`, plugins },
|
17
|
+
factory.settings,
|
18
|
+
factory.ignores,
|
19
|
+
...scopes.flatMap(scope => factory.scope(scope, options[scope])),
|
26
20
|
];
|
27
21
|
}
|
28
22
|
catch (e) {
|
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,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAK7C,MAAM,CAAC,OAAO,WAAW,EACvB,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAC7B,QAAQ,EACR,UAAU,GACJ;IACN,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,EACjD,OAAO,GAA+E;YACpF,EAAE,EAAE,IAAI,OAAO,CAAC,EAAE,CAAC,EAAW,CAAC;YAC/B,EAAE,EAAE,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAU,CAAC;YACzC,MAAM,EAAE,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAU,CAAC;YACjE,KAAK,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAU,CAAC;YAC/C,IAAI,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAU,CAAC;YAC/C,IAAI,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAU,CAAC;YAChD,KAAK,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAU,CAAC;YAClD,GAAG,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAU,CAAC;SACpC,CAAC;QAEX,OAAO;YACL,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAW;YAC9C,OAAO,CAAC,QAAQ;YAChB,OAAO,CAAC,OAAO;YACf,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;SACxD,CAAC;IACb,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import type * as Rule from "./rule.js";
|
2
|
+
export type { Rule };
|
3
|
+
export interface Config<Plugins extends string = string> {
|
4
|
+
readonly name: `linted/${string}`;
|
5
|
+
readonly plugins: Readonly<Record<Plugins, {
|
6
|
+
readonly configs: unknown;
|
7
|
+
}>>;
|
8
|
+
readonly files: readonly string[];
|
9
|
+
readonly ignores: readonly string[];
|
10
|
+
readonly rules: Rule.Config;
|
11
|
+
readonly linterOptions: {
|
12
|
+
readonly noInlineConfig: boolean;
|
13
|
+
readonly reportUnusedDisableDirectives: "error" | "warn" | "off";
|
14
|
+
};
|
15
|
+
readonly languageOptions: {
|
16
|
+
readonly sourceType: "module" | "script";
|
17
|
+
readonly ecmaVersion: "latest" | 3 | 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024;
|
18
|
+
};
|
19
|
+
readonly processor?: string;
|
20
|
+
readonly language?: string;
|
21
|
+
readonly settings?: Readonly<Record<string, unknown>>;
|
22
|
+
}
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,QAAQ,CAAC;AAEpC,YAAY,EAAE,IAAI,EAAE,CAAC;AACrB,MAAM,WAAW,MAAM,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IACrD,QAAQ,CAAC,IAAI,EAAE,UAAU,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;IAC3E,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE;QACtB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;QACjC,QAAQ,CAAC,6BAA6B,EAClC,OAAO,GACP,MAAM,GACN,KAAK,CACR;KACF,CAAC;IACF,QAAQ,CAAC,eAAe,EAAE;QACxB,QAAQ,CAAC,UAAU,EACf,QAAQ,GACR,QAAQ,CACX;QACD,QAAQ,CAAC,WAAW,EAChB,QAAQ,GACR,CAAC,GACD,CAAC,GACD,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CACP;KACF,CAAC;IACF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/config/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rule.d.ts","sourceRoot":"","sources":["../../../src/interface/config/rule.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,SAAS;IAC3B,MAAM;IACN,MAAM;CACP,CAAC;AACF,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAClC,MAAM,EACJ,KAAK,GACL,SAAS,CAAC,KAAK,EAAE,GAAG,SAAS,OAAO,EAAE,CAAC,CAC1C,CAAC,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAChB,OAAO,GACP,MAAM,GACN,KAAK,CACR,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rule.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../../../src/interface/config/rule.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ignores.d.ts","sourceRoot":"","sources":["../../../../src/interface/configs/globals/ignores.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,MAAM,OAAO,GAAG,IAAI,CACxB,MAAM,EACN,CACI;IAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GACrC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAC1B,CACF,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ignores.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/ignores.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/configs/globals/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,YAAY,CAAC;AAChC,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,QAAQ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/interface/configs/globals/only/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,CACd,IAAI,SAAS,MAAM,EACnB,IAAI,SAAS,MAAM,IACjB,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/interface/configs/globals/only/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../src/interface/configs/globals/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,MAAM,OAAO,GAAG,IAAI,CACxB,MAAM,EACN,CACI;IAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GACrC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAC3C,CACF,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/plugins.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { Config } from "../../index.js";
|
2
|
+
import type { Only } from "./only/index.js";
|
3
|
+
export type Settings = Only<Config, ({
|
4
|
+
readonly name: `linted/*/settings`;
|
5
|
+
readonly languageOptions: Pick<Config["languageOptions"], "ecmaVersion" | "sourceType">;
|
6
|
+
} & Pick<Config, "linterOptions">)>;
|
7
|
+
//# sourceMappingURL=settings.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/interface/configs/globals/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,MAAM,QAAQ,GAAG,IAAI,CACzB,MAAM,EACN,CACI;IACA,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC,CAAC;CACzF,GACC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,CAChC,CACF,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/settings.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/configs/index.ts"],"names":[],"mappings":"AAAA,YAAY,KAAK,OAAO,MAAM,WAAW,CAAC;AAC1C,mBAAmB,UAAU,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/configs/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { Config } from "../index.js";
|
2
|
+
import type { Scopes } from "../../index.js";
|
3
|
+
export type Scoped = {
|
4
|
+
readonly name: `linted/${Scopes}:${string}`;
|
5
|
+
readonly languageOptions: Omit<Config["languageOptions"], "sourceType" | "ecmaVersion">;
|
6
|
+
} & Pick<Config, "files" | "ignores" | "rules" | "processor" | "language" | "settings">;
|
7
|
+
//# sourceMappingURL=scoped.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scoped.d.ts","sourceRoot":"","sources":["../../../src/interface/configs/scoped.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,IAAI,EAAE,UAAU,MAAM,IAAI,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC;CACzF,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scoped.js","sourceRoot":"","sources":["../../../src/interface/configs/scoped.ts"],"names":[],"mappings":""}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export type
|
2
|
-
export type
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
1
|
+
export type * from "./plugins.js";
|
2
|
+
export type * from "./parsers.js";
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/imports/index.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/imports/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,WAAW,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../src/interface/imports/parsers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAClB,IAAI,GACJ,QAAQ,GACR,MAAM,GACN,OAAO,GACP,KAAK,CACR,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../../src/interface/imports/parsers.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/interface/imports/plugins.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAClB,YAAY,GACZ,oBAAoB,GACpB,QAAQ,GACR,OAAO,GACP,cAAc,GACd,OAAO,GACP,KAAK,CACR,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/interface/imports/plugins.ts"],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,YAAY,KAAK,OAAO,MAAM,WAAW,CAAC;AAC1C,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,SAAS,CAAC;AAC7B,mBAAmB,UAAU,CAAC"}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import type {
|
2
|
-
import type {
|
1
|
+
import type { Config, Rule, Imports } from "./index.js";
|
2
|
+
import type { Scopes } from "../index.js";
|
3
3
|
export interface Input {
|
4
|
-
imports: {
|
5
|
-
plugins: Config<
|
6
|
-
parsers: Record<
|
4
|
+
readonly imports: {
|
5
|
+
readonly plugins: Config<Imports.Plugins>["plugins"];
|
6
|
+
readonly parsers: Readonly<Record<Imports.Parsers, unknown>>;
|
7
7
|
};
|
8
|
-
defaults: {
|
9
|
-
settings: Config["linterOptions"] & Pick<Config["languageOptions"], "ecmaVersion" | "sourceType">;
|
10
|
-
files: Record<"*" | Scopes, string[]
|
11
|
-
ignores: Input["defaults"]["files"];
|
12
|
-
rules: Record<Scopes,
|
8
|
+
readonly defaults: {
|
9
|
+
readonly settings: Config["linterOptions"] & Pick<Config["languageOptions"], "ecmaVersion" | "sourceType">;
|
10
|
+
readonly files: Readonly<Record<"*" | Scopes, readonly string[]>>;
|
11
|
+
readonly ignores: Input["defaults"]["files"];
|
12
|
+
readonly rules: Readonly<Record<Scopes, readonly Rule.Entry[]>>;
|
13
13
|
};
|
14
|
-
extensions: Partial<Record<"*", Partial<Input["defaults"]["settings"] & Pick<Config, "ignores"> & {
|
15
|
-
override?: boolean;
|
16
|
-
}>> & Record<Scopes, Partial<Pick<Config, "files" | "ignores" | "rules"
|
14
|
+
readonly extensions: Readonly<Partial<Record<"*", Partial<Input["defaults"]["settings"] & Pick<Config, "ignores"> & {
|
15
|
+
readonly override?: boolean;
|
16
|
+
}>> & Record<Scopes, Partial<Pick<Config, "files" | "ignores" | "rules">>>>>;
|
17
17
|
}
|
18
18
|
//# sourceMappingURL=input.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/interface/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/interface/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAEjC,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;QACrD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAC/B,OAAO,CAAC,OAAO,EACf,OAAO,CACR,CAAC,CAAC;KACJ,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC,CAAC;QAC3G,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;QAClE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC;QAC7C,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KACjE,CAAC;IACF,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CACjC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,GAC/G,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CACvE,CAAC,CAAC;CACJ"}
|
@@ -1,17 +1,9 @@
|
|
1
|
-
import type
|
2
|
-
|
3
|
-
export type
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
} & Pick<Config<ImportPlugins>, "plugins" | "linterOptions">>,
|
9
|
-
Exclusive<Config, {
|
10
|
-
name: `linted/*/ignores`;
|
11
|
-
} & Pick<Config, "ignores">>,
|
12
|
-
...({
|
13
|
-
name: `linted/${Scopes}:${string}`;
|
14
|
-
languageOptions: Omit<Config["languageOptions"], "sourceType" | "ecmaVersion">;
|
15
|
-
} & Pick<Config, "files" | "ignores" | "rules" | "processor" | "language" | "settings">)[]
|
1
|
+
import type * as Configs from "./configs/index.js";
|
2
|
+
export type { Configs };
|
3
|
+
export type Output = readonly [
|
4
|
+
Configs.Globals.Plugins,
|
5
|
+
Configs.Globals.Settings,
|
6
|
+
Configs.Globals.Ignores,
|
7
|
+
...readonly Configs.Scoped[]
|
16
8
|
];
|
17
9
|
//# sourceMappingURL=output.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/interface/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/interface/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,CAAC;AAE1C,YAAY,EAAE,OAAO,EAAE,CAAC;AACxB,MAAM,MAAM,MAAM,GAAG,SAAS;IAC5B,OAAO,CAAC,OAAO,CAAC,OAAO;IACvB,OAAO,CAAC,OAAO,CAAC,QAAQ;IACxB,OAAO,CAAC,OAAO,CAAC,OAAO;IACvB,GAAG,SAAS,OAAO,CAAC,MAAM,EAAE;CAC7B,CAAC"}
|
package/package.json
CHANGED
@@ -0,0 +1,89 @@
|
|
1
|
+
import type { Scopes, Input } from "..";
|
2
|
+
import { Ruleset } from "./ruleset";
|
3
|
+
import type Options from "./settings";
|
4
|
+
|
5
|
+
export class Factory {
|
6
|
+
public readonly extensions: {
|
7
|
+
readonly global: NonNullable<Input["extensions"]["*"]>;
|
8
|
+
readonly scopes: Omit<Input["extensions"], "*">;
|
9
|
+
};
|
10
|
+
|
11
|
+
constructor(
|
12
|
+
public readonly defaults: Input["defaults"],
|
13
|
+
{ "*": global = {}, ...scopes }: Input["extensions"] = {} as const,
|
14
|
+
) {
|
15
|
+
this.extensions = { global, scopes } as const;
|
16
|
+
}
|
17
|
+
|
18
|
+
public get settings() {
|
19
|
+
const {
|
20
|
+
defaults: { settings },
|
21
|
+
extensions: {
|
22
|
+
global: {
|
23
|
+
noInlineConfig = settings.noInlineConfig,
|
24
|
+
reportUnusedDisableDirectives = settings.reportUnusedDisableDirectives,
|
25
|
+
sourceType = settings.sourceType,
|
26
|
+
ecmaVersion = settings.ecmaVersion,
|
27
|
+
},
|
28
|
+
},
|
29
|
+
} = this;
|
30
|
+
|
31
|
+
return {
|
32
|
+
name: "linted/*/settings",
|
33
|
+
linterOptions: { noInlineConfig, reportUnusedDisableDirectives } as const,
|
34
|
+
languageOptions: { sourceType, ecmaVersion } as const,
|
35
|
+
} as const;
|
36
|
+
}
|
37
|
+
|
38
|
+
public get ignores() {
|
39
|
+
const {
|
40
|
+
defaults: { ignores: { "*": defaults } },
|
41
|
+
extensions: {
|
42
|
+
global: {
|
43
|
+
ignores = [] as const,
|
44
|
+
override = false,
|
45
|
+
},
|
46
|
+
},
|
47
|
+
} = this;
|
48
|
+
|
49
|
+
return {
|
50
|
+
name: "linted/*/ignores",
|
51
|
+
ignores: [
|
52
|
+
...override ? [] as const : defaults,
|
53
|
+
...ignores,
|
54
|
+
] as const,
|
55
|
+
} as const;
|
56
|
+
}
|
57
|
+
|
58
|
+
public scope<S extends Scopes>(scope: S, settings: InstanceType<typeof Options[S]>) {
|
59
|
+
const {
|
60
|
+
defaults: {
|
61
|
+
files: { [scope]: defaultFiles },
|
62
|
+
ignores: { [scope]: defaultIgnores },
|
63
|
+
rules: { [scope]: defaultRules },
|
64
|
+
},
|
65
|
+
extensions: { scopes: { [scope]: scopeExtension = {} as const } },
|
66
|
+
} = this,
|
67
|
+
{
|
68
|
+
files: extendFiles = [] as const,
|
69
|
+
ignores: extendIgnores = [] as const,
|
70
|
+
rules: extendRules,
|
71
|
+
} = scopeExtension,
|
72
|
+
files = [...defaultFiles, ...extendFiles] as const,
|
73
|
+
ignores = [...defaultIgnores, ...extendIgnores] as const,
|
74
|
+
ruleset = new Ruleset(scope, defaultRules, extendRules);
|
75
|
+
|
76
|
+
if (ruleset.scope !== settings.scope)
|
77
|
+
throw new TypeError(`Scope mismatch between config "${settings.scope} and inner ruleset "${ruleset.scope}"`);
|
78
|
+
|
79
|
+
return files.length < 1
|
80
|
+
? [] as const
|
81
|
+
: ruleset.ruleset.map(({ id, rules }) => ({
|
82
|
+
name: `linted/${id}`,
|
83
|
+
files,
|
84
|
+
ignores,
|
85
|
+
rules,
|
86
|
+
...settings.option,
|
87
|
+
} as const));
|
88
|
+
}
|
89
|
+
}
|
package/src/factory/index.ts
CHANGED