@eslinted/core 14.0.0-rc.2 → 14.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/factory/index.d.ts +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.spec.js +16 -7
- package/dist/index.spec.js.map +1 -1
- package/dist/interface/input/imports.d.ts +6 -2
- package/dist/interface/input/imports.d.ts.map +1 -1
- package/dist/interface/input/index.d.ts +2 -2
- package/dist/interface/input/index.d.ts.map +1 -1
- package/dist/interface/output/common/index.d.ts +1 -0
- package/dist/interface/output/common/index.d.ts.map +1 -1
- package/dist/interface/output/common/plugins.d.ts +3 -0
- package/dist/interface/output/common/plugins.d.ts.map +1 -0
- package/dist/interface/output/common/plugins.js +2 -0
- package/dist/interface/output/common/plugins.js.map +1 -0
- package/dist/interface/output/index.d.ts +3 -2
- package/dist/interface/output/index.d.ts.map +1 -1
- package/dist/interface/output/scope/settings.d.ts +1 -1
- package/dist/interface/output/scope/settings.d.ts.map +1 -1
- package/dist/interface/shared/config/index.d.ts +4 -5
- package/dist/interface/shared/config/index.d.ts.map +1 -1
- package/dist/interface/shared/config/partial.d.ts +5 -0
- package/dist/interface/shared/config/partial.d.ts.map +1 -0
- package/dist/interface/shared/config/partial.js +2 -0
- package/dist/interface/shared/config/partial.js.map +1 -0
- package/dist/scopes/imports/index.d.ts +1 -0
- package/dist/scopes/imports/index.d.ts.map +1 -1
- package/dist/scopes/imports/plugins.d.ts +2 -0
- package/dist/scopes/imports/plugins.d.ts.map +1 -0
- package/dist/scopes/imports/plugins.js +2 -0
- package/dist/scopes/imports/plugins.js.map +1 -0
- package/dist/test/input.d.ts.map +1 -1
- package/dist/test/input.js +11 -1
- package/dist/test/input.js.map +1 -1
- package/package.json +1 -1
- package/src/index.spec.ts +16 -7
- package/src/index.ts +2 -1
- package/src/interface/input/imports.ts +10 -5
- package/src/interface/input/index.ts +5 -2
- package/src/interface/output/common/index.ts +1 -0
- package/src/interface/output/common/plugins.ts +7 -0
- package/src/interface/output/index.ts +3 -1
- package/src/interface/output/scope/settings.ts +1 -0
- package/src/interface/shared/config/index.ts +7 -24
- package/src/interface/shared/config/partial.ts +25 -0
- package/src/scopes/imports/index.ts +1 -0
- package/src/scopes/imports/plugins.ts +10 -0
- package/src/test/input.ts +12 -1
package/dist/factory/index.d.ts
CHANGED
@@ -21,16 +21,16 @@ export declare class Factory {
|
|
21
21
|
};
|
22
22
|
};
|
23
23
|
readonly scopes: {
|
24
|
-
readonly files: Readonly<Record<"
|
25
|
-
readonly ignores: Readonly<Record<"*" | "
|
26
|
-
readonly rules: Readonly<Record<"
|
24
|
+
readonly files: Readonly<Record<"svelte" | "mocha" | "jsonc" | "yml" | "ts" | "html" | "json" | "js", string[]>>;
|
25
|
+
readonly ignores: Readonly<Record<"*" | "svelte" | "mocha" | "jsonc" | "yml" | "ts" | "html" | "json" | "js", string[]>>;
|
26
|
+
readonly rules: Readonly<Record<"svelte" | "mocha" | "jsonc" | "yml" | "ts" | "html" | "json" | "js", import("../interface/shared/config/rule/index.js").NamedBag[]>>;
|
27
27
|
};
|
28
28
|
constructor(tree: typeof Tree, parsers: Input["imports"]["parsers"], { settings: defaultSettings, files: defaultFiles, ignores: defaultIgnores, rules: defaultRules, }: Input["defaults"], { "*": commonExtension, ...scopeExtensions }?: Input["extensions"]);
|
29
29
|
scope<S extends keyof typeof ScopeManifests>(scope: S): readonly [
|
30
30
|
] | ({
|
31
31
|
readonly name: `linted/${S}/${string}/`;
|
32
|
-
readonly files: Readonly<Record<"
|
33
|
-
readonly ignores: Readonly<Record<"*" | "
|
32
|
+
readonly files: Readonly<Record<"svelte" | "mocha" | "jsonc" | "yml" | "ts" | "html" | "json" | "js", string[]>>[S];
|
33
|
+
readonly ignores: Readonly<Record<"*" | "svelte" | "mocha" | "jsonc" | "yml" | "ts" | "html" | "json" | "js", string[]>>[S];
|
34
34
|
readonly rules: Readonly<Record<string, import("../interface/shared/config/rule/index.js").State | readonly [
|
35
35
|
import("../interface/shared/config/rule/index.js").State,
|
36
36
|
...unknown[]
|
@@ -38,8 +38,8 @@ export declare class Factory {
|
|
38
38
|
} | {
|
39
39
|
readonly processor?: "svelte/svelte";
|
40
40
|
readonly name: `linted/${S}/`;
|
41
|
-
readonly files: Readonly<Record<"
|
42
|
-
readonly ignores: Readonly<Record<"*" | "
|
41
|
+
readonly files: Readonly<Record<"svelte" | "mocha" | "jsonc" | "yml" | "ts" | "html" | "json" | "js", string[]>>[S];
|
42
|
+
readonly ignores: Readonly<Record<"*" | "svelte" | "mocha" | "jsonc" | "yml" | "ts" | "html" | "json" | "js", string[]>>[S];
|
43
43
|
readonly languageOptions: {
|
44
44
|
readonly parserOptions?: {
|
45
45
|
readonly parser?: unknown;
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { Input, Output } from "./interface/index.js";
|
2
2
|
export type * from "./interface/index.js";
|
3
3
|
export type * from "./scopes/index.js";
|
4
|
-
export default function ({ imports: { parsers }, defaults, extensions, }: Input): Output;
|
4
|
+
export default function ({ imports: { plugins, parsers }, defaults, extensions, }: Input): Output;
|
5
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":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIjD,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,UAAU,CAAC;AAC9B,MAAM,CAAC,OAAO,WAAW,EACvB,OAAO,EAAE,EAAE,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIjD,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,UAAU,CAAC;AAC9B,MAAM,CAAC,OAAO,WAAW,EACvB,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAC7B,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,GAAG,MAAM,CAchB"}
|
package/dist/index.js
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import { scopes, tree } from "./scopes/index.js";
|
2
2
|
import { Factory } from "./factory/index.js";
|
3
|
-
export default function ({ imports: { parsers }, defaults, extensions, }) {
|
3
|
+
export default function ({ imports: { plugins, parsers }, defaults, extensions, }) {
|
4
4
|
try {
|
5
5
|
const factory = new Factory(tree, parsers, defaults, extensions);
|
6
6
|
return [
|
7
|
+
{ name: "plugins", plugins },
|
7
8
|
factory.common.settings,
|
8
9
|
factory.common.ignores,
|
9
10
|
...scopes.flatMap(scope => factory.scope(scope)),
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,MAAM,CAAC,OAAO,WAAW,EACvB,OAAO,EAAE,EAAE,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,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,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;QAEjE,OAAO;YACL,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAW;YACrC,OAAO,CAAC,MAAM,CAAC,QAAQ;YACvB,OAAO,CAAC,MAAM,CAAC,OAAO;YACtB,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxC,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"}
|
package/dist/index.spec.js
CHANGED
@@ -19,7 +19,7 @@ describe("Core", function () {
|
|
19
19
|
expect(configs)
|
20
20
|
.has.lengthOf.above(1);
|
21
21
|
});
|
22
|
-
it(`with length >= */ignores + */settings + ${scopes.length} scopes = ${scopes.length +
|
22
|
+
it(`with length >= plugins + */ignores + */settings + ${scopes.length} scopes = ${scopes.length + 3} [Actual: ${configs.length}`, function () {
|
23
23
|
expect(configs)
|
24
24
|
.lengthOf.above(scopes.length + 2);
|
25
25
|
});
|
@@ -29,14 +29,23 @@ describe("Core", function () {
|
|
29
29
|
});
|
30
30
|
});
|
31
31
|
describe("configs", function () {
|
32
|
-
it("begin with
|
33
|
-
expect(configs[0])
|
34
|
-
.has.property("name", "linted/*/");
|
35
|
-
expect(configs[0])
|
36
|
-
.has.property("linterOptions");
|
32
|
+
it("begin with plugins", function () {
|
37
33
|
expect(configs[0])
|
38
|
-
.has.
|
34
|
+
.has.property("name", "plugins");
|
39
35
|
expect(configs[0])
|
36
|
+
.has.property("plugins")
|
37
|
+
.an("object");
|
38
|
+
});
|
39
|
+
it("begin with common settings", function () {
|
40
|
+
expect(configs[1])
|
41
|
+
.has.property("name", "linted/*/");
|
42
|
+
expect(configs[1])
|
43
|
+
.has.property("linterOptions")
|
44
|
+
.an("object");
|
45
|
+
expect(configs[1])
|
46
|
+
.has.nested.property("languageOptions.sourceType")
|
47
|
+
.a("string");
|
48
|
+
expect(configs[1])
|
40
49
|
.has.nested.property("languageOptions.ecmaVersion");
|
41
50
|
});
|
42
51
|
});
|
package/dist/index.spec.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,IAAI,MAAM,GAAG,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;AAEhC,QAAQ,CAAC,MAAM,EAAE;IACf,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,eAAe,EAAE;YAClB,MAAM,CAAC,IAAI,CAAC;iBACT,CAAC,CAAC,UAAU,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,QAAQ,EAAE;QACjB,EAAE,CAAC,aAAa,EAAE;YAChB,MAAM,CAAC,OAAO,CAAC;iBACZ,EAAE,CAAC,OAAO,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,WAAW,EAAE;YACd,MAAM,CAAC,OAAO,CAAC;iBACZ,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAG3B,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,IAAI,MAAM,GAAG,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;AAEhC,QAAQ,CAAC,MAAM,EAAE;IACf,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,eAAe,EAAE;YAClB,MAAM,CAAC,IAAI,CAAC;iBACT,CAAC,CAAC,UAAU,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,QAAQ,EAAE;QACjB,EAAE,CAAC,aAAa,EAAE;YAChB,MAAM,CAAC,OAAO,CAAC;iBACZ,EAAE,CAAC,OAAO,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,WAAW,EAAE;YACd,MAAM,CAAC,OAAO,CAAC;iBACZ,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAG3B,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,qDAAqD,MAAM,CAAC,MAAM,aAAa,MAAM,CAAC,MAAM,GAAG,CAAC,cAAc,OAAO,CAAC,MAAM,EAAE,EAAE;YACjI,MAAM,CAAC,OAAO,CAAC;iBACZ,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,qCAAqC,EAAE;YACxC,MAAM,CAAC,OAAO,CAAC;iBACZ,SAAS,CAAC,CAAC,OAA2B,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;QAC/K,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,SAAS,EAAE;QAClB,EAAE,CAAC,oBAAoB,EAAE;YACvB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;iBACf,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YACnC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;iBACf,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC;iBACvB,EAAE,CAAC,QAAQ,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,4BAA4B,EAAE;YAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;iBACf,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YACrC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;iBACf,GAAG,CAAC,QAAQ,CAAC,eAAe,CAAC;iBAC7B,EAAE,CAAC,QAAQ,CAAC,CAAC;YAChB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;iBACf,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,4BAA4B,CAAC;iBACjD,CAAC,CAAC,QAAQ,CAAC,CAAC;YACf,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;iBACf,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -1,2 +1,6 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import type { Config } from "../shared/index.js";
|
2
|
+
export interface Imports<Plugins extends string, Parsers extends string> {
|
3
|
+
readonly plugins: Config<Plugins>["plugins"];
|
4
|
+
readonly parsers: Readonly<Record<Parsers, unknown>>;
|
5
|
+
}
|
6
|
+
//# sourceMappingURL=imports.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../../src/interface/input/imports.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../../src/interface/input/imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,WAAW,OAAO,CACtB,OAAO,SAAS,MAAM,EACtB,OAAO,SAAS,MAAM;IAEtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAC/B,OAAO,EACP,OAAO,CACR,CAAC,CAAC;CACJ"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { Imports } from "./imports.js";
|
2
2
|
import type { Defaults, Extensions } from "./scopes/index.js";
|
3
|
-
import type { Parsers, Scopes } from "../../scopes/index.js";
|
3
|
+
import type { Plugins, Parsers, Scopes } from "../../scopes/index.js";
|
4
4
|
export interface Input {
|
5
|
-
readonly imports: Imports<Parsers>;
|
5
|
+
readonly imports: Imports<Plugins, Parsers>;
|
6
6
|
readonly defaults: Defaults<Scopes>;
|
7
7
|
readonly extensions: Extensions<Scopes>;
|
8
8
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CACvB,OAAO,EACP,OAAO,CACR,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;CACzC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/output/common/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAC;AAChC,mBAAmB,WAAW,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interface/output/common/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,YAAY,CAAC;AAChC,mBAAmB,WAAW,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../src/interface/output/common/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,aAAa,CAAC,OAAO,SAAS,MAAM,IAAI,aAAa,CAC/D,SAAS,EACT,SAAS,EACT,OAAO,CACR,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../src/interface/output/common/plugins.ts"],"names":[],"mappings":""}
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import type { CommonSettings, CommonIgnores } from "./common/index.js";
|
1
|
+
import type { CommonPlugins, CommonSettings, CommonIgnores } from "./common/index.js";
|
2
2
|
import type { ScopeSettings, ScopeRules } from "./scope/index.js";
|
3
|
-
import type { Scopes } from "../../scopes/index.js";
|
3
|
+
import type { Plugins, Scopes } from "../../scopes/index.js";
|
4
4
|
export type Output = readonly [
|
5
|
+
CommonPlugins<Plugins>,
|
5
6
|
CommonSettings,
|
6
7
|
CommonIgnores,
|
7
8
|
...readonly (ScopeSettings<Scopes> | ScopeRules<Scopes>)[]
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/output/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/output/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACd,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,MAAM,MAAM,GAAG,SAAS;IAC5B,aAAa,CAAC,OAAO,CAAC;IACtB,cAAc;IACd,aAAa;IACb,GAAG,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE;CAC3D,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { PartialConfig } from "../../shared/index.js";
|
2
|
-
export type ScopeSettings<Scopes extends string> = PartialConfig<`linted/${Scopes}/`, "files" | "ignores" | "processor" | "language" | "settings", {
|
2
|
+
export type ScopeSettings<Scopes extends string> = PartialConfig<`linted/${Scopes}/`, "files" | "ignores" | "processor" | "language" | "settings", string, {
|
3
3
|
readonly languageOptions: object;
|
4
4
|
}>;
|
5
5
|
//# sourceMappingURL=settings.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/interface/output/scope/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,aAAa,CAAC,MAAM,SAAS,MAAM,IAAI,aAAa,CAC9D,UAAU,MAAM,GAAG,EACjB,OAAO,GACP,SAAS,GACT,WAAW,GACX,UAAU,GACV,UAAU,EAEZ;IAAE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CACrC,CAAC"}
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/interface/output/scope/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,aAAa,CAAC,MAAM,SAAS,MAAM,IAAI,aAAa,CAC9D,UAAU,MAAM,GAAG,EACjB,OAAO,GACP,SAAS,GACT,WAAW,GACX,UAAU,GACV,UAAU,EAEZ,MAAM,EACN;IAAE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CACrC,CAAC"}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import type * as Rule from "./rule/index.js";
|
2
|
+
export type * from "./partial.js";
|
2
3
|
export type { Rule };
|
3
|
-
export interface Config {
|
4
|
-
readonly name: `linted/${string}
|
4
|
+
export interface Config<Plugins extends string = string> {
|
5
|
+
readonly name: ("plugins" | `linted/${string}/`);
|
6
|
+
readonly plugins: Readonly<Record<Plugins, unknown>>;
|
5
7
|
readonly files: readonly string[];
|
6
8
|
readonly ignores: readonly string[];
|
7
9
|
readonly rules: Rule.Bag;
|
@@ -17,7 +19,4 @@ export interface Config {
|
|
17
19
|
readonly language?: string;
|
18
20
|
readonly settings?: Readonly<Record<string, unknown>>;
|
19
21
|
}
|
20
|
-
export type PartialConfig<Name extends Config["name"], Picks extends Exclude<keyof Config, "name" | keyof Rest>, Rest extends object = object> = (Rest & Pick<Config, Picks> & {
|
21
|
-
readonly name: Name;
|
22
|
-
} & Readonly<Partial<Record<Exclude<keyof Config, "name" | keyof Rest | Picks>, never>>>);
|
23
22
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +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;
|
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,mBAAmB,WAAW,CAAC;AAC/B,YAAY,EAAE,IAAI,EAAE,CAAC;AACrB,MAAM,WAAW,MAAM,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IACrD,QAAQ,CAAC,IAAI,EAAE,CACX,SAAS,GACT,UAAU,MAAM,GAAG,CACtB,CAAC;IACF,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,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"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { Config } from "./index.js";
|
2
|
+
export type PartialConfig<Name extends Config["name"], Picks extends Exclude<keyof Config, "name" | keyof Rest>, Plugins extends string = string, Rest extends object = object> = (Rest & Pick<Config<Plugins>, Picks> & {
|
3
|
+
readonly name: Name;
|
4
|
+
} & Readonly<Partial<Record<Exclude<keyof Config, "name" | keyof Rest | Picks>, never>>>);
|
5
|
+
//# sourceMappingURL=partial.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"partial.d.ts","sourceRoot":"","sources":["../../../../src/interface/shared/config/partial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAEhC,MAAM,MAAM,aAAa,CACvB,IAAI,SAAS,MAAM,CAAC,MAAM,CAAC,EAC3B,KAAK,SAAS,OAAO,CACnB,MAAM,MAAM,EACV,MAAM,GACN,MAAM,IAAI,CACb,EACD,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/B,IAAI,SAAS,MAAM,GAAG,MAAM,IAC1B,CACA,IAAI,GACJ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GACvB,QAAQ,CAAC,OAAO,CAAC,MAAM,CACvB,OAAO,CACL,MAAM,MAAM,EACV,MAAM,GACN,MAAM,IAAI,GACV,KAAK,CACR,EACD,KAAK,CACN,CAAC,CAAC,CACJ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"partial.js","sourceRoot":"","sources":["../../../../src/interface/shared/config/partial.ts"],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scopes/imports/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAC"}
|
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":"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,eAAe,GACf,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":""}
|
package/dist/test/input.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/test/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,IAAI,CAAC;
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/test/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,IAAI,CAAC;AAO3B,eAAO,MAAM,SAAS,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAmGvC,CAAC"}
|
package/dist/test/input.js
CHANGED
@@ -1,6 +1,16 @@
|
|
1
|
-
const ERROR = "error", OFF = "off";
|
1
|
+
const ERROR = "error", OFF = "off", Plugin = "TEST_PLUGIN";
|
2
2
|
export const TestInput = {
|
3
3
|
imports: {
|
4
|
+
plugins: {
|
5
|
+
"@html-eslint": Plugin,
|
6
|
+
"@stylistic": Plugin,
|
7
|
+
"@typescript-eslint": Plugin,
|
8
|
+
mocha: Plugin,
|
9
|
+
"chai-friendly": Plugin,
|
10
|
+
svelte: Plugin,
|
11
|
+
jsonc: Plugin,
|
12
|
+
yml: Plugin,
|
13
|
+
},
|
4
14
|
parsers: {
|
5
15
|
ts: "parsers.ts",
|
6
16
|
svelte: "parsers.svelte",
|
package/dist/test/input.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/test/input.ts"],"names":[],"mappings":"AAEA,MACA,KAAK,GAAG,OAAO,EACf,GAAG,GAAG,KAAK,CAAC;
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/test/input.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
package/src/index.spec.ts
CHANGED
@@ -23,7 +23,7 @@ describe("Core", function () {
|
|
23
23
|
// .not.empty;
|
24
24
|
// replace with not.empty after new rule
|
25
25
|
});
|
26
|
-
it(`with length >= */ignores + */settings + ${scopes.length} scopes = ${scopes.length +
|
26
|
+
it(`with length >= plugins + */ignores + */settings + ${scopes.length} scopes = ${scopes.length + 3} [Actual: ${configs.length}`, function () {
|
27
27
|
expect(configs)
|
28
28
|
.lengthOf.above(scopes.length + 2);
|
29
29
|
});
|
@@ -33,14 +33,23 @@ describe("Core", function () {
|
|
33
33
|
});
|
34
34
|
});
|
35
35
|
describe("configs", function () {
|
36
|
-
it("begin with
|
37
|
-
expect(configs[0])
|
38
|
-
.has.property("name", "linted/*/");
|
39
|
-
expect(configs[0])
|
40
|
-
.has.property("linterOptions");
|
36
|
+
it("begin with plugins", function () {
|
41
37
|
expect(configs[0])
|
42
|
-
.has.
|
38
|
+
.has.property("name", "plugins");
|
43
39
|
expect(configs[0])
|
40
|
+
.has.property("plugins")
|
41
|
+
.an("object");
|
42
|
+
});
|
43
|
+
it("begin with common settings", function () {
|
44
|
+
expect(configs[1])
|
45
|
+
.has.property("name", "linted/*/");
|
46
|
+
expect(configs[1])
|
47
|
+
.has.property("linterOptions")
|
48
|
+
.an("object");
|
49
|
+
expect(configs[1])
|
50
|
+
.has.nested.property("languageOptions.sourceType")
|
51
|
+
.a("string");
|
52
|
+
expect(configs[1])
|
44
53
|
.has.nested.property("languageOptions.ecmaVersion");
|
45
54
|
});
|
46
55
|
});
|
package/src/index.ts
CHANGED
@@ -5,7 +5,7 @@ import { Factory } from "./factory";
|
|
5
5
|
export type * from "./interface";
|
6
6
|
export type * from "./scopes";
|
7
7
|
export default function ({
|
8
|
-
imports: { parsers },
|
8
|
+
imports: { plugins, parsers },
|
9
9
|
defaults,
|
10
10
|
extensions,
|
11
11
|
}: Input): Output {
|
@@ -13,6 +13,7 @@ export default function ({
|
|
13
13
|
const factory = new Factory(tree, parsers, defaults, extensions);
|
14
14
|
|
15
15
|
return [
|
16
|
+
{ name: "plugins", plugins } as const,
|
16
17
|
factory.common.settings,
|
17
18
|
factory.common.ignores,
|
18
19
|
...scopes.flatMap(scope => factory.scope(scope)),
|
@@ -1,7 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import type { Config } from "../shared";
|
2
|
+
|
3
|
+
export interface Imports<
|
4
|
+
Plugins extends string,
|
5
|
+
Parsers extends string,
|
6
|
+
> {
|
7
|
+
readonly plugins: Config<Plugins>["plugins"];
|
8
|
+
readonly parsers: Readonly<Record<
|
4
9
|
Parsers,
|
5
10
|
unknown
|
6
|
-
|
7
|
-
|
11
|
+
>>;
|
12
|
+
}
|
@@ -1,9 +1,12 @@
|
|
1
1
|
import type { Imports } from "./imports";
|
2
2
|
import type { Defaults, Extensions } from "./scopes";
|
3
|
-
import type { Parsers, Scopes } from "../../scopes";
|
3
|
+
import type { Plugins, Parsers, Scopes } from "../../scopes";
|
4
4
|
|
5
5
|
export interface Input {
|
6
|
-
readonly imports: Imports<
|
6
|
+
readonly imports: Imports<
|
7
|
+
Plugins,
|
8
|
+
Parsers
|
9
|
+
>;
|
7
10
|
readonly defaults: Defaults<Scopes>;
|
8
11
|
readonly extensions: Extensions<Scopes>;
|
9
12
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import type {
|
2
|
+
CommonPlugins,
|
2
3
|
CommonSettings,
|
3
4
|
CommonIgnores,
|
4
5
|
} from "./common";
|
@@ -6,9 +7,10 @@ import type {
|
|
6
7
|
ScopeSettings,
|
7
8
|
ScopeRules,
|
8
9
|
} from "./scope";
|
9
|
-
import type { Scopes } from "../../scopes";
|
10
|
+
import type { Plugins, Scopes } from "../../scopes";
|
10
11
|
|
11
12
|
export type Output = readonly [
|
13
|
+
CommonPlugins<Plugins>,
|
12
14
|
CommonSettings,
|
13
15
|
CommonIgnores,
|
14
16
|
...readonly (ScopeSettings<Scopes> | ScopeRules<Scopes>)[],
|
@@ -1,8 +1,13 @@
|
|
1
1
|
import type * as Rule from "./rule";
|
2
2
|
|
3
|
+
export type * from "./partial";
|
3
4
|
export type { Rule };
|
4
|
-
export interface Config {
|
5
|
-
readonly name:
|
5
|
+
export interface Config<Plugins extends string = string> {
|
6
|
+
readonly name: (
|
7
|
+
| "plugins"
|
8
|
+
| `linted/${string}/`
|
9
|
+
);
|
10
|
+
readonly plugins: Readonly<Record<Plugins, unknown>>;
|
6
11
|
readonly files: readonly string[];
|
7
12
|
readonly ignores: readonly string[];
|
8
13
|
readonly rules: Rule.Bag;
|
@@ -39,25 +44,3 @@ export interface Config {
|
|
39
44
|
readonly language?: string;
|
40
45
|
readonly settings?: Readonly<Record<string, unknown>>;
|
41
46
|
}
|
42
|
-
export type PartialConfig<
|
43
|
-
Name extends Config["name"],
|
44
|
-
Picks extends Exclude<
|
45
|
-
keyof Config,
|
46
|
-
| "name"
|
47
|
-
| keyof Rest
|
48
|
-
>,
|
49
|
-
Rest extends object = object,
|
50
|
-
> = (
|
51
|
-
& Rest
|
52
|
-
& Pick<Config, Picks>
|
53
|
-
& { readonly name: Name }
|
54
|
-
& Readonly<Partial<Record<
|
55
|
-
Exclude<
|
56
|
-
keyof Config,
|
57
|
-
| "name"
|
58
|
-
| keyof Rest
|
59
|
-
| Picks
|
60
|
-
>,
|
61
|
-
never
|
62
|
-
>>>
|
63
|
-
);
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { Config } from ".";
|
2
|
+
|
3
|
+
export type PartialConfig<
|
4
|
+
Name extends Config["name"],
|
5
|
+
Picks extends Exclude<
|
6
|
+
keyof Config,
|
7
|
+
| "name"
|
8
|
+
| keyof Rest
|
9
|
+
>,
|
10
|
+
Plugins extends string = string,
|
11
|
+
Rest extends object = object,
|
12
|
+
> = (
|
13
|
+
& Rest
|
14
|
+
& Pick<Config<Plugins>, Picks>
|
15
|
+
& { readonly name: Name }
|
16
|
+
& Readonly<Partial<Record<
|
17
|
+
Exclude<
|
18
|
+
keyof Config,
|
19
|
+
| "name"
|
20
|
+
| keyof Rest
|
21
|
+
| Picks
|
22
|
+
>,
|
23
|
+
never
|
24
|
+
>>>
|
25
|
+
);
|
package/src/test/input.ts
CHANGED
@@ -2,10 +2,21 @@ import type Core from "..";
|
|
2
2
|
|
3
3
|
const
|
4
4
|
ERROR = "error",
|
5
|
-
OFF = "off"
|
5
|
+
OFF = "off",
|
6
|
+
Plugin = "TEST_PLUGIN";
|
6
7
|
|
7
8
|
export const TestInput: Parameters<typeof Core>[0] = {
|
8
9
|
imports: {
|
10
|
+
plugins: {
|
11
|
+
"@html-eslint": Plugin,
|
12
|
+
"@stylistic": Plugin,
|
13
|
+
"@typescript-eslint": Plugin,
|
14
|
+
mocha: Plugin,
|
15
|
+
"chai-friendly": Plugin,
|
16
|
+
svelte: Plugin,
|
17
|
+
jsonc: Plugin,
|
18
|
+
yml: Plugin,
|
19
|
+
} as const,
|
9
20
|
parsers: {
|
10
21
|
ts: "parsers.ts",
|
11
22
|
svelte: "parsers.svelte",
|