@eslinted/core 13.1.0 → 13.2.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 +42 -42
- package/dist/factory/factory.d.ts.map +1 -1
- package/dist/factory/factory.js +11 -6
- package/dist/factory/factory.js.map +1 -1
- package/dist/index.d.ts +1 -1
- 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 -15
- 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 -5
- 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 +16 -7
- package/src/index.ts +2 -2
- package/src/interface/index.ts +1 -2
- package/src/interface/input.ts +8 -19
- 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 +6 -5
- 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/factory/ruleset.d.ts +0 -10
- package/dist/factory/ruleset.d.ts.map +0 -1
- package/dist/factory/ruleset.js +0 -18
- package/dist/factory/ruleset.js.map +0 -1
- 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/factory/ruleset.ts +0 -23
- 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/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","sourceRoot":"","sources":["../../src/scopes/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAE3B,QAAQ,CAAC,QAAQ,EAAE;IACjB,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,sBAAsB,EAAE;YACzB,MAAM,CAAC,MAAM,CAAC;iBACX,EAAE,CAAC,OAAO,CAAC;iBACX,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,cAAc,EAAE;YACjB,MAAM,CAAC,MAAM,CAAC;iBACX,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;YACvC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;iBAC5B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,SAAS,EAAE;YACZ,MAAM,CAAC,MAAM,CAAC;iBACX,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YAClC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBACzB,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,YAAY,EAAE;YACf,MAAM,CAAC,MAAM,CAAC;iBACX,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;YACrC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;iBAC5B,WAAW,CAAC,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,5 +1,4 @@
|
|
1
|
-
import type { Scopes, Input } from "..";
|
2
|
-
import { Ruleset } from "./ruleset";
|
1
|
+
import type { Scopes, Rule, Input } from "..";
|
3
2
|
import type Options from "./settings";
|
4
3
|
|
5
4
|
export class Factory {
|
@@ -56,6 +55,19 @@ export class Factory {
|
|
56
55
|
}
|
57
56
|
|
58
57
|
public scope<S extends Scopes>(scope: S, settings: InstanceType<typeof Options[S]>) {
|
58
|
+
function Ruleset<Scopes extends string>(
|
59
|
+
scope: Scopes,
|
60
|
+
defaults: readonly Rule.NamedBag[],
|
61
|
+
override?: Rule.Bag,
|
62
|
+
) {
|
63
|
+
return [
|
64
|
+
...defaults.map(([id, rules]: Rule.NamedBag) => ({ id: `${scope}:${id}`, rules } as const)),
|
65
|
+
...typeof override === "undefined"
|
66
|
+
? [] as const
|
67
|
+
: [{ id: `${scope}:override`, rules: override } as const] as const,
|
68
|
+
] as const;
|
69
|
+
}
|
70
|
+
|
59
71
|
const {
|
60
72
|
defaults: {
|
61
73
|
files: { [scope]: defaultFiles },
|
@@ -71,14 +83,11 @@ export class Factory {
|
|
71
83
|
} = scopeExtension,
|
72
84
|
files = [...defaultFiles, ...extendFiles] as const,
|
73
85
|
ignores = [...defaultIgnores, ...extendIgnores] as const,
|
74
|
-
ruleset =
|
75
|
-
|
76
|
-
if (ruleset.scope !== settings.scope)
|
77
|
-
throw new TypeError(`Scope mismatch between config "${settings.scope} and inner ruleset "${ruleset.scope}"`);
|
86
|
+
ruleset = Ruleset<Scopes>(scope, defaultRules, extendRules);
|
78
87
|
|
79
88
|
return files.length < 1
|
80
89
|
? [] as const
|
81
|
-
: ruleset.
|
90
|
+
: ruleset.map(({ id, rules }) => ({
|
82
91
|
name: `linted/${id}`,
|
83
92
|
files,
|
84
93
|
ignores,
|
package/src/index.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
+
import type { Input, Output } from "./interface";
|
1
2
|
import { scopes } from "./scopes";
|
2
3
|
import { Factory, Options } from "./factory";
|
3
|
-
import type { Input, Output } from "./interface";
|
4
4
|
|
5
|
-
export type { Scopes } from "./scopes";
|
6
5
|
export type * from "./interface";
|
6
|
+
export type * from "./scopes";
|
7
7
|
export default function ({
|
8
8
|
imports: { plugins, parsers },
|
9
9
|
defaults,
|
package/src/interface/index.ts
CHANGED
package/src/interface/input.ts
CHANGED
@@ -1,22 +1,11 @@
|
|
1
|
-
import type {
|
2
|
-
import type
|
1
|
+
import type { Scopes, Plugins, Parsers } from "../scopes";
|
2
|
+
import type * as Inputs from "./inputs";
|
3
3
|
|
4
4
|
export interface Input {
|
5
|
-
readonly imports:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
};
|
12
|
-
readonly defaults: {
|
13
|
-
readonly settings: Config["linterOptions"] & Pick<Config["languageOptions"], "ecmaVersion" | "sourceType">;
|
14
|
-
readonly files: Readonly<Record<"*" | Scopes, readonly string[]>>;
|
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
|
-
>>;
|
5
|
+
readonly imports: Inputs.Imports<
|
6
|
+
Plugins,
|
7
|
+
Parsers
|
8
|
+
>;
|
9
|
+
readonly defaults: Inputs.Defaults<Scopes>;
|
10
|
+
readonly extensions: Inputs.Extensions<Scopes>;
|
22
11
|
}
|
@@ -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,10 @@
|
|
1
|
-
import type
|
1
|
+
import type { Scopes, Plugins } from "../scopes";
|
2
|
+
import type * as Configs from "./outputs";
|
2
3
|
|
3
4
|
export type { Configs };
|
4
5
|
export type Output = readonly [
|
5
|
-
Configs.
|
6
|
-
Configs.
|
7
|
-
Configs.
|
8
|
-
...readonly Configs.Scoped[],
|
6
|
+
Configs.Common.Plugins<Plugins>,
|
7
|
+
Configs.Common.Settings,
|
8
|
+
Configs.Common.Ignores,
|
9
|
+
...readonly Configs.Scoped<Scopes>[],
|
9
10
|
];
|
@@ -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,10 +0,0 @@
|
|
1
|
-
import type { Scopes, Rule } from "../index.js";
|
2
|
-
export declare class Ruleset {
|
3
|
-
readonly scope: Scopes;
|
4
|
-
readonly ruleset: {
|
5
|
-
id: `${Scopes}:${string}`;
|
6
|
-
rules: Rule.Config;
|
7
|
-
}[];
|
8
|
-
constructor(scope: Scopes, defaults: readonly Rule.Entry[], override?: Rule.Config);
|
9
|
-
}
|
10
|
-
//# sourceMappingURL=ruleset.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ruleset.d.ts","sourceRoot":"","sources":["../../src/factory/ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAEvC,qBAAa,OAAO;aAIA,KAAK,EAAE,MAAM;IAH/B,SAAgB,OAAO,EAAE;QAAE,EAAE,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAA;KAAE,EAAE,CAAC;gBAG3D,KAAK,EAAE,MAAM,EAC7B,QAAQ,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE,EAC/B,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM;CAczB"}
|
package/dist/factory/ruleset.js
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
export class Ruleset {
|
2
|
-
scope;
|
3
|
-
ruleset;
|
4
|
-
constructor(scope, defaults, override) {
|
5
|
-
this.scope = scope;
|
6
|
-
const map = ([id, rules]) => ({
|
7
|
-
id: `${scope}:${id}`,
|
8
|
-
rules,
|
9
|
-
});
|
10
|
-
this.ruleset = [
|
11
|
-
...defaults.map(rule => map(rule)),
|
12
|
-
...typeof override === "undefined"
|
13
|
-
? []
|
14
|
-
: [map([`${scope}:override`, override])],
|
15
|
-
];
|
16
|
-
}
|
17
|
-
}
|
18
|
-
//# sourceMappingURL=ruleset.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ruleset.js","sourceRoot":"","sources":["../../src/factory/ruleset.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,OAAO;IAIA;IAHF,OAAO,CAAsD;IAE7E,YACkB,KAAa,EAC7B,QAA+B,EAC/B,QAAsB;QAFN,UAAK,GAAL,KAAK,CAAQ;QAI7B,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,CAAa,EAAE,EAAE,CAAC,CAAC;YACxC,EAAE,EAAE,GAAG,KAAK,IAAI,EAAE,EAAE;YACpB,KAAK;SACI,CAAA,CAAC;QAEZ,IAAI,CAAC,OAAO,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J,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 +0,0 @@
|
|
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 +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"}
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../../src/interface/imports/parsers.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/interface/imports/plugins.ts"],"names":[],"mappings":""}
|
package/dist/scopes.d.ts
DELETED
package/dist/scopes.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AAC3C,eAAO,MAAM,MAAM,0EAST,CAAC"}
|
package/dist/scopes.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scopes.js","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;CACG,CAAC"}
|
package/dist/scopes.spec.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scopes.spec.d.ts","sourceRoot":"","sources":["../src/scopes.spec.ts"],"names":[],"mappings":""}
|
package/dist/scopes.spec.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scopes.spec.js","sourceRoot":"","sources":["../src/scopes.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAQ,CAAC,QAAQ,EAAE;IACjB,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,sBAAsB,EAAE;YACzB,MAAM,CAAC,MAAM,CAAC;iBACX,EAAE,CAAC,OAAO,CAAC;iBACX,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,C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-
import type { Scopes, Rule } from "..";
|
2
|
-
|
3
|
-
export class Ruleset {
|
4
|
-
public readonly ruleset: { id: `${Scopes}:${string}`; rules: Rule.Config }[];
|
5
|
-
|
6
|
-
constructor(
|
7
|
-
public readonly scope: Scopes,
|
8
|
-
defaults: readonly Rule.Entry[],
|
9
|
-
override?: Rule.Config,
|
10
|
-
) {
|
11
|
-
const map = ([id, rules]: Rule.Entry) => ({
|
12
|
-
id: `${scope}:${id}`,
|
13
|
-
rules,
|
14
|
-
} as const);
|
15
|
-
|
16
|
-
this.ruleset = [
|
17
|
-
...defaults.map(rule => map(rule)),
|
18
|
-
...typeof override === "undefined"
|
19
|
-
? [] as const
|
20
|
-
: [map([`${scope}:override`, override])] as const,
|
21
|
-
] as const;
|
22
|
-
}
|
23
|
-
}
|