@eslinted/core 13.1.0-rc.2 → 13.2.0-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/factory/factory.d.ts +47 -46
- package/dist/factory/factory.d.ts.map +1 -1
- package/dist/factory/factory.js.map +1 -1
- package/dist/factory/ruleset.d.ts +4 -4
- package/dist/factory/ruleset.d.ts.map +1 -1
- package/dist/factory/ruleset.js.map +1 -1
- package/dist/factory/settings/setting.d.ts.map +1 -1
- package/dist/factory/settings/setting.js +6 -11
- package/dist/factory/settings/setting.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interface/index.d.ts +1 -2
- package/dist/interface/index.d.ts.map +1 -1
- package/dist/interface/input.d.ts +5 -16
- package/dist/interface/input.d.ts.map +1 -1
- package/dist/interface/inputs/imports.d.ts +6 -0
- package/dist/interface/inputs/imports.d.ts.map +1 -0
- package/dist/interface/inputs/imports.js +2 -0
- package/dist/interface/inputs/imports.js.map +1 -0
- package/dist/interface/inputs/index.d.ts +3 -0
- package/dist/interface/inputs/index.d.ts.map +1 -0
- package/dist/interface/{config → inputs}/index.js.map +1 -1
- package/dist/interface/inputs/options/defaults.d.ts +8 -0
- package/dist/interface/inputs/options/defaults.d.ts.map +1 -0
- package/dist/interface/inputs/options/defaults.js +2 -0
- package/dist/interface/inputs/options/defaults.js.map +1 -0
- package/dist/interface/inputs/options/index.d.ts +13 -0
- package/dist/interface/inputs/options/index.d.ts.map +1 -0
- package/dist/interface/inputs/options/index.js.map +1 -0
- package/dist/interface/output.d.ts +6 -6
- package/dist/interface/output.d.ts.map +1 -1
- package/dist/interface/outputs/common/ignores.d.ts +5 -0
- package/dist/interface/outputs/common/ignores.d.ts.map +1 -0
- package/dist/interface/outputs/common/ignores.js.map +1 -0
- package/dist/interface/{configs/globals → outputs/common}/index.d.ts +0 -1
- package/dist/interface/outputs/common/index.d.ts.map +1 -0
- package/dist/interface/outputs/common/index.js.map +1 -0
- package/dist/interface/outputs/common/plugins.d.ts +5 -0
- package/dist/interface/outputs/common/plugins.d.ts.map +1 -0
- package/dist/interface/outputs/common/plugins.js.map +1 -0
- package/dist/interface/outputs/common/settings.d.ts +5 -0
- package/dist/interface/outputs/common/settings.d.ts.map +1 -0
- package/dist/interface/outputs/common/settings.js.map +1 -0
- package/dist/interface/{configs → outputs}/index.d.ts +1 -1
- package/dist/interface/outputs/index.d.ts.map +1 -0
- package/dist/interface/{imports → outputs}/index.js.map +1 -1
- package/dist/interface/{configs → outputs}/scoped.d.ts +1 -2
- package/dist/interface/outputs/scoped.d.ts.map +1 -0
- package/dist/interface/{configs → outputs}/scoped.js.map +1 -1
- package/dist/interface/{config → shared/config}/index.d.ts +3 -2
- package/dist/interface/shared/config/index.d.ts.map +1 -0
- package/dist/interface/shared/config/index.js.map +1 -0
- package/dist/interface/shared/config/rule/index.d.ts +7 -0
- package/dist/interface/shared/config/rule/index.d.ts.map +1 -0
- package/dist/interface/shared/config/rule/index.js +2 -0
- package/dist/interface/shared/config/rule/index.js.map +1 -0
- package/dist/interface/shared/index.d.ts +2 -0
- package/dist/interface/shared/index.d.ts.map +1 -0
- package/dist/interface/shared/index.js +2 -0
- package/dist/interface/{configs → shared}/index.js.map +1 -1
- package/dist/scopes/imports/index.d.ts.map +1 -0
- package/dist/scopes/imports/index.js +2 -0
- package/dist/scopes/imports/index.js.map +1 -0
- package/dist/scopes/imports/parsers.d.ts.map +1 -0
- package/dist/scopes/imports/parsers.js.map +1 -0
- package/dist/scopes/imports/plugins.d.ts.map +1 -0
- package/dist/scopes/imports/plugins.js.map +1 -0
- package/dist/scopes/index.d.ts +13 -0
- package/dist/scopes/index.d.ts.map +1 -0
- package/dist/{scopes.js → scopes/index.js} +1 -1
- package/dist/scopes/index.js.map +1 -0
- package/dist/scopes/index.spec.d.ts +2 -0
- package/dist/scopes/index.spec.d.ts.map +1 -0
- package/dist/{scopes.spec.js → scopes/index.spec.js} +2 -2
- package/dist/scopes/index.spec.js.map +1 -0
- package/package.json +1 -1
- package/src/factory/factory.ts +7 -6
- package/src/factory/ruleset.ts +6 -6
- package/src/factory/settings/setting.ts +6 -9
- package/src/index.ts +4 -3
- package/src/interface/index.ts +1 -2
- package/src/interface/input.ts +12 -20
- package/src/interface/inputs/imports.ts +12 -0
- package/src/interface/inputs/index.ts +2 -0
- package/src/interface/inputs/options/defaults.ts +8 -0
- package/src/interface/inputs/options/index.ts +19 -0
- package/src/interface/output.ts +9 -6
- package/src/interface/outputs/common/ignores.ts +6 -0
- package/src/interface/{configs/globals → outputs/common}/index.ts +0 -1
- package/src/interface/outputs/common/plugins.ts +7 -0
- package/src/interface/outputs/common/settings.ts +7 -0
- package/src/interface/outputs/index.ts +2 -0
- package/src/interface/{configs → outputs}/scoped.ts +1 -2
- package/src/interface/{config → shared/config}/index.ts +18 -3
- package/src/interface/{config/rule.ts → shared/config/rule/index.ts} +3 -3
- package/src/interface/shared/index.ts +1 -0
- package/src/{scopes.spec.ts → scopes/index.spec.ts} +1 -1
- package/src/{scopes.ts → scopes/index.ts} +1 -0
- package/dist/interface/config/index.d.ts.map +0 -1
- package/dist/interface/config/rule.d.ts +0 -7
- package/dist/interface/config/rule.d.ts.map +0 -1
- package/dist/interface/config/rule.js +0 -2
- package/dist/interface/config/rule.js.map +0 -1
- package/dist/interface/configs/globals/ignores.d.ts +0 -6
- package/dist/interface/configs/globals/ignores.d.ts.map +0 -1
- package/dist/interface/configs/globals/ignores.js.map +0 -1
- package/dist/interface/configs/globals/index.d.ts.map +0 -1
- package/dist/interface/configs/globals/index.js.map +0 -1
- package/dist/interface/configs/globals/only/index.d.ts +0 -2
- package/dist/interface/configs/globals/only/index.d.ts.map +0 -1
- package/dist/interface/configs/globals/only/index.js.map +0 -1
- package/dist/interface/configs/globals/plugins.d.ts +0 -6
- package/dist/interface/configs/globals/plugins.d.ts.map +0 -1
- package/dist/interface/configs/globals/plugins.js.map +0 -1
- package/dist/interface/configs/globals/settings.d.ts +0 -7
- package/dist/interface/configs/globals/settings.d.ts.map +0 -1
- package/dist/interface/configs/globals/settings.js.map +0 -1
- package/dist/interface/configs/index.d.ts.map +0 -1
- package/dist/interface/configs/scoped.d.ts.map +0 -1
- package/dist/interface/imports/index.d.ts.map +0 -1
- package/dist/interface/imports/parsers.d.ts.map +0 -1
- package/dist/interface/imports/parsers.js.map +0 -1
- package/dist/interface/imports/plugins.d.ts.map +0 -1
- package/dist/interface/imports/plugins.js.map +0 -1
- package/dist/scopes.d.ts +0 -3
- package/dist/scopes.d.ts.map +0 -1
- package/dist/scopes.js.map +0 -1
- package/dist/scopes.spec.d.ts +0 -2
- package/dist/scopes.spec.d.ts.map +0 -1
- package/dist/scopes.spec.js.map +0 -1
- package/src/interface/configs/globals/ignores.ts +0 -10
- package/src/interface/configs/globals/only/index.ts +0 -4
- package/src/interface/configs/globals/plugins.ts +0 -10
- package/src/interface/configs/globals/settings.ts +0 -13
- package/src/interface/configs/index.ts +0 -2
- /package/dist/interface/{config → inputs}/index.js +0 -0
- /package/dist/interface/{configs/globals → inputs/options}/index.js +0 -0
- /package/dist/interface/{configs/globals → outputs/common}/ignores.js +0 -0
- /package/dist/interface/{configs/globals/only → outputs/common}/index.js +0 -0
- /package/dist/interface/{configs/globals → outputs/common}/plugins.js +0 -0
- /package/dist/interface/{configs/globals → outputs/common}/settings.js +0 -0
- /package/dist/interface/{configs → outputs}/index.js +0 -0
- /package/dist/interface/{configs → outputs}/scoped.js +0 -0
- /package/dist/interface/{imports → shared/config}/index.js +0 -0
- /package/dist/{interface → scopes}/imports/index.d.ts +0 -0
- /package/dist/{interface → scopes}/imports/parsers.d.ts +0 -0
- /package/dist/{interface → scopes}/imports/parsers.js +0 -0
- /package/dist/{interface → scopes}/imports/plugins.d.ts +0 -0
- /package/dist/{interface → scopes}/imports/plugins.js +0 -0
- /package/src/{interface → scopes}/imports/index.ts +0 -0
- /package/src/{interface → scopes}/imports/parsers.ts +0 -0
- /package/src/{interface → scopes}/imports/plugins.ts +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/outputs/index.ts"],"names":[],"mappings":""}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { Config } from "../index.js";
|
2
|
-
|
3
|
-
export type Scoped = {
|
2
|
+
export type Scoped<Scopes extends string> = {
|
4
3
|
readonly name: `linted/${Scopes}:${string}`;
|
5
4
|
readonly languageOptions: Omit<Config["languageOptions"], "sourceType" | "ecmaVersion">;
|
6
5
|
} & Pick<Config, "files" | "ignores" | "rules" | "processor" | "language" | "settings">;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scoped.d.ts","sourceRoot":"","sources":["../../../src/interface/outputs/scoped.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAEjC,MAAM,MAAM,MAAM,CAAC,MAAM,SAAS,MAAM,IAAI;IAC1C,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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scoped.js","sourceRoot":"","sources":["../../../src/interface/
|
1
|
+
{"version":3,"file":"scoped.js","sourceRoot":"","sources":["../../../src/interface/outputs/scoped.ts"],"names":[],"mappings":""}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type * as Rule from "./rule.js";
|
1
|
+
import type * as Rule from "./rule/index.js";
|
2
2
|
export type { Rule };
|
3
3
|
export interface Config<Plugins extends string = string> {
|
4
4
|
readonly name: `linted/${string}`;
|
@@ -7,7 +7,7 @@ export interface Config<Plugins extends string = string> {
|
|
7
7
|
}>>;
|
8
8
|
readonly files: readonly string[];
|
9
9
|
readonly ignores: readonly string[];
|
10
|
-
readonly rules: Rule.
|
10
|
+
readonly rules: Rule.Bag;
|
11
11
|
readonly linterOptions: {
|
12
12
|
readonly noInlineConfig: boolean;
|
13
13
|
readonly reportUnusedDisableDirectives: "error" | "warn" | "off";
|
@@ -20,4 +20,5 @@ export interface Config<Plugins extends string = string> {
|
|
20
20
|
readonly language?: string;
|
21
21
|
readonly settings?: Readonly<Record<string, unknown>>;
|
22
22
|
}
|
23
|
+
export type PartialConfig<This extends object, Picks extends Exclude<keyof Config, keyof This>, Plugins extends string = string> = (This & Pick<Config<Plugins>, Picks> & Readonly<Partial<Record<Exclude<keyof Config, Picks | keyof This>, never>>>);
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/shared/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,CAC/B,OAAO,EACP;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAC9B,CAAC,CAAC;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC;IACzB,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,CAAsF;IACvF,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;AACD,MAAM,MAAM,aAAa,CACvB,IAAI,SAAS,MAAM,EACnB,KAAK,SAAS,OAAO,CAAC,MAAM,MAAM,EAAE,MAAM,IAAI,CAAC,EAC/C,OAAO,SAAS,MAAM,GAAG,MAAM,IAC7B,CACA,IAAI,GACJ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,GAC5B,QAAQ,CAAC,OAAO,CAAC,MAAM,CACvB,OAAO,CAAC,MAAM,MAAM,EAAE,KAAK,GAAG,MAAM,IAAI,CAAC,EACzC,KAAK,CACN,CAAC,CAAC,CACJ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interface/shared/config/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/interface/shared/config/rule/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,SAAS;IAC9B,MAAM;IACN,GAAG;CACJ,CAAC;AACF,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAC/B,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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/interface/shared/config/rule/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/shared/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,UAAU,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/shared/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scopes/imports/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,WAAW,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/scopes/imports/index.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../src/scopes/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/scopes/imports/parsers.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/scopes/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/scopes/imports/plugins.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAC;AAC/B,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AAC3C,eAAO,MAAM,MAAM,0EAST,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scopes/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;CACG,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../src/scopes/index.spec.ts"],"names":[],"mappings":""}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { expect } from "chai";
|
2
|
-
import { scopes } from "./
|
2
|
+
import { scopes } from "./index.js";
|
3
3
|
describe("Scopes", function () {
|
4
4
|
describe("shape", function () {
|
5
5
|
it("is a non-empty array", function () {
|
@@ -34,4 +34,4 @@ describe("Scopes", function () {
|
|
34
34
|
});
|
35
35
|
});
|
36
36
|
});
|
37
|
-
//# sourceMappingURL=
|
37
|
+
//# sourceMappingURL=index.spec.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.spec.js","sour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AC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,aAAa,EAAE;YAChB,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;iBAC7B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/factory/factory.ts
CHANGED
@@ -1,16 +1,17 @@
|
|
1
|
-
import type { Scopes
|
1
|
+
import type { Scopes } from "..";
|
2
|
+
import type Core from "..";
|
2
3
|
import { Ruleset } from "./ruleset";
|
3
4
|
import type Options from "./settings";
|
4
5
|
|
5
6
|
export class Factory {
|
6
7
|
public readonly extensions: {
|
7
|
-
readonly global: NonNullable<
|
8
|
-
readonly scopes: Omit<
|
8
|
+
readonly global: NonNullable<Parameters<typeof Core>[0]["extensions"]["*"]>;
|
9
|
+
readonly scopes: Omit<Parameters<typeof Core>[0]["extensions"], "*">;
|
9
10
|
};
|
10
11
|
|
11
12
|
constructor(
|
12
|
-
public readonly defaults:
|
13
|
-
{ "*": global = {}, ...scopes }:
|
13
|
+
public readonly defaults: Parameters<typeof Core>[0]["defaults"],
|
14
|
+
{ "*": global = {}, ...scopes }: Parameters<typeof Core>[0]["extensions"] = {} as const,
|
14
15
|
) {
|
15
16
|
this.extensions = { global, scopes } as const;
|
16
17
|
}
|
@@ -71,7 +72,7 @@ export class Factory {
|
|
71
72
|
} = scopeExtension,
|
72
73
|
files = [...defaultFiles, ...extendFiles] as const,
|
73
74
|
ignores = [...defaultIgnores, ...extendIgnores] as const,
|
74
|
-
ruleset = new Ruleset(scope, defaultRules, extendRules);
|
75
|
+
ruleset = new Ruleset<Scopes>(scope, defaultRules, extendRules);
|
75
76
|
|
76
77
|
if (ruleset.scope !== settings.scope)
|
77
78
|
throw new TypeError(`Scope mismatch between config "${settings.scope} and inner ruleset "${ruleset.scope}"`);
|
package/src/factory/ruleset.ts
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Rule } from "..";
|
2
2
|
|
3
|
-
export class Ruleset {
|
4
|
-
public readonly ruleset: { id: `${Scopes}:${string}`; rules: Rule.
|
3
|
+
export class Ruleset<Scopes extends string> {
|
4
|
+
public readonly ruleset: { id: `${Scopes}:${string}`; rules: Rule.Bag }[];
|
5
5
|
|
6
6
|
constructor(
|
7
7
|
public readonly scope: Scopes,
|
8
|
-
defaults: readonly Rule.
|
9
|
-
override?: Rule.
|
8
|
+
defaults: readonly Rule.NamedBag[],
|
9
|
+
override?: Rule.Bag,
|
10
10
|
) {
|
11
|
-
const map = ([id, rules]: Rule.
|
11
|
+
const map = ([id, rules]: Rule.NamedBag) => ({
|
12
12
|
id: `${scope}:${id}`,
|
13
13
|
rules,
|
14
14
|
} as const);
|
@@ -29,16 +29,13 @@ export abstract class ScopeSetting<
|
|
29
29
|
constructor(public readonly parser: readonly unknown[] & { length: ParserCount }) {}
|
30
30
|
|
31
31
|
public get option() {
|
32
|
-
|
33
|
-
const { languageOptions, processor, language } = this;
|
32
|
+
const { languageOptions, processor, language } = this;
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}
|
41
|
-
catch (e) { throw new Error(`linted.factory.Option/scope:${this.scope}: option`, { cause: e }); }
|
34
|
+
return {
|
35
|
+
languageOptions,
|
36
|
+
...processor,
|
37
|
+
...language,
|
38
|
+
} as const;
|
42
39
|
}
|
43
40
|
|
44
41
|
protected abstract get languageOptions():
|
package/src/index.ts
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
+
import type { Input, Output } from "./interface";
|
2
|
+
import type { Scopes, Plugins, Parsers } from "./scopes";
|
1
3
|
import { scopes } from "./scopes";
|
2
4
|
import { Factory, Options } from "./factory";
|
3
|
-
import type { Input, Output } from "./interface";
|
4
5
|
|
5
|
-
export type { Scopes } from "./scopes";
|
6
6
|
export type * from "./interface";
|
7
|
+
export type * from "./scopes";
|
7
8
|
export default function ({
|
8
9
|
imports: { plugins, parsers },
|
9
10
|
defaults,
|
10
11
|
extensions,
|
11
|
-
}: Input): Output {
|
12
|
+
}: Input<Scopes, Plugins, Parsers>): Output<Scopes, Plugins> {
|
12
13
|
try {
|
13
14
|
const factory = new Factory(defaults, extensions),
|
14
15
|
options: { readonly [S in typeof scopes[number]]: InstanceType<typeof Options[S]> } = {
|
package/src/interface/index.ts
CHANGED
package/src/interface/input.ts
CHANGED
@@ -1,22 +1,14 @@
|
|
1
|
-
import type
|
2
|
-
import type { Scopes } from "..";
|
1
|
+
import type * as Inputs from "./inputs";
|
3
2
|
|
4
|
-
export interface Input
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
readonly ignores: Input["defaults"]["files"];
|
16
|
-
readonly rules: Readonly<Record<Scopes, readonly Rule.Entry[]>>;
|
17
|
-
};
|
18
|
-
readonly extensions: Readonly<Partial<
|
19
|
-
& Record<"*", Partial<Input["defaults"]["settings"] & Pick<Config, "ignores"> & { readonly override?: boolean }>>
|
20
|
-
& Record<Scopes, Partial<Pick<Config, "files" | "ignores" | "rules">>>
|
21
|
-
>>;
|
3
|
+
export interface Input<
|
4
|
+
Scopes extends string,
|
5
|
+
Plugins extends string,
|
6
|
+
Parsers extends string,
|
7
|
+
> {
|
8
|
+
readonly imports: Inputs.Imports<
|
9
|
+
Plugins,
|
10
|
+
Parsers
|
11
|
+
>;
|
12
|
+
readonly defaults: Inputs.Defaults<Scopes>;
|
13
|
+
readonly extensions: Inputs.Extensions<Scopes>;
|
22
14
|
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { Config, Rule } from "../../shared";
|
2
|
+
|
3
|
+
export interface Defaults<Scopes extends string> {
|
4
|
+
readonly settings: Config["linterOptions"] & Config["languageOptions"];
|
5
|
+
readonly files: Readonly<Record<"*" | Scopes, readonly string[]>>;
|
6
|
+
readonly ignores: Defaults<Scopes>["files"];
|
7
|
+
readonly rules: Readonly<Record<Scopes, readonly Rule.NamedBag[]>>;
|
8
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import type { Defaults } from "./defaults";
|
2
|
+
|
3
|
+
export type * from "./defaults";
|
4
|
+
export type Extensions<Scopes extends string> = (
|
5
|
+
& {
|
6
|
+
readonly "*"?: Partial<Defaults<Scopes>["settings"]> & {
|
7
|
+
readonly override?: boolean;
|
8
|
+
readonly ignores?: Defaults<Scopes>["ignores"]["*"];
|
9
|
+
};
|
10
|
+
}
|
11
|
+
& Partial<Record<
|
12
|
+
Scopes,
|
13
|
+
{
|
14
|
+
readonly files?: Defaults<Scopes>["files"][Scopes];
|
15
|
+
readonly ignores?: Defaults<Scopes>["ignores"][Scopes];
|
16
|
+
readonly rules?: Defaults<Scopes>["rules"][Scopes][number][1];
|
17
|
+
}
|
18
|
+
>>
|
19
|
+
);
|
package/src/interface/output.ts
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
-
import type * as Configs from "./
|
1
|
+
import type * as Configs from "./outputs";
|
2
2
|
|
3
3
|
export type { Configs };
|
4
|
-
export type Output
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
export type Output<
|
5
|
+
Scopes extends string,
|
6
|
+
Plugins extends string,
|
7
|
+
> = readonly [
|
8
|
+
Configs.Common.Plugins<Plugins>,
|
9
|
+
Configs.Common.Settings,
|
10
|
+
Configs.Common.Ignores,
|
11
|
+
...readonly Configs.Scoped<Scopes>[],
|
9
12
|
];
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import type { Config } from "..";
|
2
|
-
import type { Scopes } from "../..";
|
3
2
|
|
4
|
-
export type Scoped = {
|
3
|
+
export type Scoped<Scopes extends string> = {
|
5
4
|
readonly name: `linted/${Scopes}:${string}`;
|
6
5
|
readonly languageOptions: Omit<Config["languageOptions"], "sourceType" | "ecmaVersion">;
|
7
6
|
} & Pick<Config, "files" | "ignores" | "rules" | "processor" | "language" | "settings">;
|
@@ -3,10 +3,13 @@ import type * as Rule from "./rule";
|
|
3
3
|
export type { Rule };
|
4
4
|
export interface Config<Plugins extends string = string> {
|
5
5
|
readonly name: `linted/${string}`;
|
6
|
-
readonly plugins: Readonly<Record<
|
6
|
+
readonly plugins: Readonly<Record<
|
7
|
+
Plugins,
|
8
|
+
{ readonly configs: unknown }
|
9
|
+
>>;
|
7
10
|
readonly files: readonly string[];
|
8
11
|
readonly ignores: readonly string[];
|
9
|
-
readonly rules: Rule.
|
12
|
+
readonly rules: Rule.Bag;
|
10
13
|
readonly linterOptions: {
|
11
14
|
readonly noInlineConfig: boolean;
|
12
15
|
readonly reportUnusedDisableDirectives:
|
@@ -35,8 +38,20 @@ export interface Config<Plugins extends string = string> {
|
|
35
38
|
| 2023
|
36
39
|
| 2024
|
37
40
|
;
|
38
|
-
}
|
41
|
+
} /* common language options -- not including extra language options for each scope */;
|
39
42
|
readonly processor?: string;
|
40
43
|
readonly language?: string;
|
41
44
|
readonly settings?: Readonly<Record<string, unknown>>;
|
42
45
|
}
|
46
|
+
export type PartialConfig<
|
47
|
+
This extends object,
|
48
|
+
Picks extends Exclude<keyof Config, keyof This>,
|
49
|
+
Plugins extends string = string,
|
50
|
+
> = (
|
51
|
+
& This
|
52
|
+
& Pick<Config<Plugins>, Picks>
|
53
|
+
& Readonly<Partial<Record<
|
54
|
+
Exclude<keyof Config, Picks | keyof This>,
|
55
|
+
never
|
56
|
+
>>>
|
57
|
+
);
|
@@ -0,0 +1 @@
|
|
1
|
+
export type * from "./config";
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/config/index.ts"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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 +0,0 @@
|
|
1
|
-
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../../../src/interface/config/rule.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ignores.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/ignores.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/index.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/interface/configs/globals/only/index.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/plugins.ts"],"names":[],"mappings":""}
|
@@ -1,7 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../src/interface/configs/globals/settings.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
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"}
|