@eslinted/core 13.4.0 → 13.4.2-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/RELEASE.yml +1 -1
- package/.github/workflows/rc.yml +1 -1
- package/dist/factory/index.d.ts +2915 -11
- package/dist/factory/index.d.ts.map +1 -1
- package/dist/factory/index.js +5 -3
- package/dist/factory/index.js.map +1 -1
- package/dist/factory/scopes/html.d.ts +6 -5
- package/dist/factory/scopes/html.d.ts.map +1 -1
- package/dist/factory/scopes/html.js +5 -2
- package/dist/factory/scopes/html.js.map +1 -1
- package/dist/factory/scopes/js.d.ts +5 -4
- package/dist/factory/scopes/js.d.ts.map +1 -1
- package/dist/factory/scopes/js.js +5 -2
- package/dist/factory/scopes/js.js.map +1 -1
- package/dist/factory/scopes/json.d.ts +6 -5
- package/dist/factory/scopes/json.d.ts.map +1 -1
- package/dist/factory/scopes/json.js +5 -2
- package/dist/factory/scopes/json.js.map +1 -1
- package/dist/factory/scopes/jsonc.d.ts +6 -5
- package/dist/factory/scopes/jsonc.d.ts.map +1 -1
- package/dist/factory/scopes/jsonc.js +5 -2
- package/dist/factory/scopes/jsonc.js.map +1 -1
- package/dist/factory/scopes/manifest/index.d.ts +13 -5995
- package/dist/factory/scopes/manifest/index.d.ts.map +1 -1
- package/dist/factory/scopes/manifest/index.js +0 -17
- package/dist/factory/scopes/manifest/index.js.map +1 -1
- package/dist/factory/scopes/mocha.d.ts +7 -32
- package/dist/factory/scopes/mocha.d.ts.map +1 -1
- package/dist/factory/scopes/mocha.js +6 -7
- package/dist/factory/scopes/mocha.js.map +1 -1
- package/dist/factory/scopes/svelte.d.ts +7 -14
- package/dist/factory/scopes/svelte.d.ts.map +1 -1
- package/dist/factory/scopes/svelte.js +6 -3
- package/dist/factory/scopes/svelte.js.map +1 -1
- package/dist/factory/scopes/ts.d.ts +7 -10
- package/dist/factory/scopes/ts.d.ts.map +1 -1
- package/dist/factory/scopes/ts.js +6 -3
- package/dist/factory/scopes/ts.js.map +1 -1
- package/dist/factory/scopes/yml.d.ts +6 -5
- package/dist/factory/scopes/yml.d.ts.map +1 -1
- package/dist/factory/scopes/yml.js +5 -2
- package/dist/factory/scopes/yml.js.map +1 -1
- package/package.json +1 -1
- package/src/factory/index.ts +14 -8
- package/src/factory/scopes/html.ts +5 -2
- package/src/factory/scopes/js.ts +5 -2
- package/src/factory/scopes/json.ts +5 -2
- package/src/factory/scopes/jsonc.ts +5 -2
- package/src/factory/scopes/manifest/index.ts +6 -48
- package/src/factory/scopes/mocha.ts +7 -13
- package/src/factory/scopes/svelte.ts +7 -13
- package/src/factory/scopes/ts.ts +7 -11
- package/src/factory/scopes/yml.ts +6 -5
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/factory/scopes/manifest/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/factory/scopes/manifest/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,8BAAsB,aAAa,CAAC,MAAM,SAAS,OAAO,GAAG,KAAK,GAAG,KAAK;IACxE,kBAAyB,SAAS,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3F,kBAAyB,QAAQ,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACzF,kBAAyB,aAAa,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IACtG,kBAAyB,eAAe,EAAE,CACxC;QAAC,MAAM;KAAC,SAAS,CAAC,OAAO,CAAC,GACtB;QAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;KAAE,GACzB;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAEhC,GAAG,CACF;QAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,MAAM,OAAO,OAAO,CAAA;KAAE,CAClD,CAAC;CACH"}
|
@@ -1,20 +1,3 @@
|
|
1
|
-
import globals from "globals";
|
2
1
|
export class ScopeManifest {
|
3
|
-
get option() {
|
4
|
-
const { languageOptions, parserOptions, processor, language, } = this;
|
5
|
-
return {
|
6
|
-
languageOptions: {
|
7
|
-
...languageOptions,
|
8
|
-
...parserOptions,
|
9
|
-
},
|
10
|
-
...processor,
|
11
|
-
...language,
|
12
|
-
};
|
13
|
-
}
|
14
|
-
globals(global) {
|
15
|
-
if (typeof global === "boolean")
|
16
|
-
throw new TypeError("`global` must be a string key of `globals` package");
|
17
|
-
return globals[global];
|
18
|
-
}
|
19
2
|
}
|
20
3
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/factory/scopes/manifest/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/factory/scopes/manifest/index.ts"],"names":[],"mappings":"AAGA,MAAM,OAAgB,aAAa;CAYlC"}
|
@@ -1,41 +1,16 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest/index.js";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
"mocha"
|
8
|
-
];
|
2
|
+
export default class MochaManifest extends ScopeManifest<"ts"> {
|
3
|
+
readonly languageOptions: {
|
4
|
+
readonly parser: "ts";
|
5
|
+
readonly globals: "mocha";
|
6
|
+
};
|
9
7
|
readonly parserOptions: {
|
10
8
|
readonly parser: null;
|
11
9
|
readonly project: "tsconfig.json";
|
12
10
|
readonly sourceType: "module";
|
13
11
|
readonly ecmaVersion: 2023;
|
14
12
|
};
|
15
|
-
readonly
|
16
|
-
|
17
|
-
readonly globals: {
|
18
|
-
readonly after: false;
|
19
|
-
readonly afterEach: false;
|
20
|
-
readonly before: false;
|
21
|
-
readonly beforeEach: false;
|
22
|
-
readonly context: false;
|
23
|
-
readonly describe: false;
|
24
|
-
readonly it: false;
|
25
|
-
readonly mocha: false;
|
26
|
-
readonly run: false;
|
27
|
-
readonly setup: false;
|
28
|
-
readonly specify: false;
|
29
|
-
readonly suite: false;
|
30
|
-
readonly suiteSetup: false;
|
31
|
-
readonly suiteTeardown: false;
|
32
|
-
readonly teardown: false;
|
33
|
-
readonly test: false;
|
34
|
-
readonly xcontext: false;
|
35
|
-
readonly xdescribe: false;
|
36
|
-
readonly xit: false;
|
37
|
-
readonly xspecify: false;
|
38
|
-
};
|
39
|
-
};
|
13
|
+
readonly processor: {};
|
14
|
+
readonly language: {};
|
40
15
|
}
|
41
16
|
//# sourceMappingURL=mocha.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../src/factory/scopes/mocha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../src/factory/scopes/mocha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,aAAa,CAAC,IAAI,CAAC;IAC5D,SAAgB,eAAe;;;MAGpB;IACX,SAAgB,aAAa;;;;;MAKlB;IACX,SAAgB,SAAS,KAAe;IACxC,SAAgB,QAAQ,KAAe;CACxC"}
|
@@ -1,17 +1,16 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest/index.js";
|
2
2
|
export default class MochaManifest extends ScopeManifest {
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
languageOptions = {
|
4
|
+
parser: "ts",
|
5
|
+
globals: "mocha",
|
6
|
+
};
|
6
7
|
parserOptions = {
|
7
8
|
parser: null,
|
8
9
|
project: "tsconfig.json",
|
9
10
|
sourceType: "module",
|
10
11
|
ecmaVersion: 2023,
|
11
12
|
};
|
12
|
-
|
13
|
-
|
14
|
-
globals: this.globals("mocha"),
|
15
|
-
};
|
13
|
+
processor = {};
|
14
|
+
language = {};
|
16
15
|
}
|
17
16
|
//# sourceMappingURL=mocha.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mocha.js","sourceRoot":"","sources":["../../../src/factory/scopes/mocha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"mocha.js","sourceRoot":"","sources":["../../../src/factory/scopes/mocha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,aAAmB;IAC5C,eAAe,GAAG;QAChC,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,OAAO;KACR,CAAC;IACK,aAAa,GAAG;QAC9B,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,eAAe;QACxB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,IAAI;KACT,CAAC;IACK,SAAS,GAAG,EAAW,CAAC;IACxB,QAAQ,GAAG,EAAW,CAAC;CACxC"}
|
@@ -1,17 +1,9 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest/index.js";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
".svelte"
|
7
|
-
];
|
8
|
-
}, false, {
|
9
|
-
readonly processor: "svelte/svelte";
|
10
|
-
}> {
|
11
|
-
readonly processor: {
|
12
|
-
readonly processor: "svelte/svelte";
|
2
|
+
export default class SvelteManifest extends ScopeManifest<"svelte" | "ts"> {
|
3
|
+
readonly languageOptions: {
|
4
|
+
readonly parser: "svelte";
|
5
|
+
readonly globals: null;
|
13
6
|
};
|
14
|
-
readonly language: {};
|
15
7
|
readonly parserOptions: {
|
16
8
|
readonly parser: "ts";
|
17
9
|
readonly extraFileExtensions: readonly [
|
@@ -21,8 +13,9 @@ export default class SvelteManifest extends ScopeManifest<"svelte" | "ts", Omit<
|
|
21
13
|
readonly sourceType: "module";
|
22
14
|
readonly ecmaVersion: 2023;
|
23
15
|
};
|
24
|
-
readonly
|
25
|
-
readonly
|
16
|
+
readonly processor: {
|
17
|
+
readonly processor: "svelte/svelte";
|
26
18
|
};
|
19
|
+
readonly language: {};
|
27
20
|
}
|
28
21
|
//# sourceMappingURL=svelte.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"svelte.d.ts","sourceRoot":"","sources":["../../../src/factory/scopes/svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"svelte.d.ts","sourceRoot":"","sources":["../../../src/factory/scopes/svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC;IACxE,SAAgB,eAAe;;;MAGpB;IACX,SAAgB,aAAa;;;;;;MAMlB;IACX,SAAgB,SAAS;;MAA2C;IACpE,SAAgB,QAAQ,KAAe;CACxC"}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest/index.js";
|
2
2
|
export default class SvelteManifest extends ScopeManifest {
|
3
|
-
|
4
|
-
|
3
|
+
languageOptions = {
|
4
|
+
parser: "svelte",
|
5
|
+
globals: null,
|
6
|
+
};
|
5
7
|
parserOptions = {
|
6
8
|
parser: "ts",
|
7
9
|
extraFileExtensions: [".svelte"],
|
@@ -9,6 +11,7 @@ export default class SvelteManifest extends ScopeManifest {
|
|
9
11
|
sourceType: "module",
|
10
12
|
ecmaVersion: 2023,
|
11
13
|
};
|
12
|
-
|
14
|
+
processor = { processor: "svelte/svelte" };
|
15
|
+
language = {};
|
13
16
|
}
|
14
17
|
//# sourceMappingURL=svelte.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"svelte.js","sourceRoot":"","sources":["../../../src/factory/scopes/svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"svelte.js","sourceRoot":"","sources":["../../../src/factory/scopes/svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,aAA8B;IACxD,eAAe,GAAG;QAChC,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,IAAI;KACL,CAAC;IACK,aAAa,GAAG;QAC9B,MAAM,EAAE,IAAI;QACZ,mBAAmB,EAAE,CAAC,SAAS,CAAU;QACzC,OAAO,EAAE,eAAe;QACxB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,IAAI;KACT,CAAC;IACK,SAAS,GAAG,EAAE,SAAS,EAAE,eAAe,EAAW,CAAC;IACpD,QAAQ,GAAG,EAAW,CAAC;CACxC"}
|
@@ -1,19 +1,16 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest/index.js";
|
2
|
-
export default class TsManifest extends ScopeManifest<"ts"
|
3
|
-
readonly
|
4
|
-
|
5
|
-
|
6
|
-
}
|
7
|
-
readonly processor: {};
|
8
|
-
readonly language: {};
|
2
|
+
export default class TsManifest extends ScopeManifest<"ts"> {
|
3
|
+
readonly languageOptions: {
|
4
|
+
readonly parser: "ts";
|
5
|
+
readonly globals: null;
|
6
|
+
};
|
9
7
|
readonly parserOptions: {
|
10
8
|
readonly parser: null;
|
11
9
|
readonly project: "tsconfig.json";
|
12
10
|
readonly sourceType: "module";
|
13
11
|
readonly ecmaVersion: 2023;
|
14
12
|
};
|
15
|
-
readonly
|
16
|
-
|
17
|
-
};
|
13
|
+
readonly processor: {};
|
14
|
+
readonly language: {};
|
18
15
|
}
|
19
16
|
//# sourceMappingURL=ts.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ts.d.ts","sourceRoot":"","sources":["../../../src/factory/scopes/ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,aAAa,
|
1
|
+
{"version":3,"file":"ts.d.ts","sourceRoot":"","sources":["../../../src/factory/scopes/ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,aAAa,CAAC,IAAI,CAAC;IACzD,SAAgB,eAAe;;;MAGpB;IACX,SAAgB,aAAa;;;;;MAKlB;IACX,SAAgB,SAAS,KAAe;IACxC,SAAgB,QAAQ,KAAe;CACxC"}
|
@@ -1,13 +1,16 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest/index.js";
|
2
2
|
export default class TsManifest extends ScopeManifest {
|
3
|
-
|
4
|
-
|
3
|
+
languageOptions = {
|
4
|
+
parser: "ts",
|
5
|
+
globals: null,
|
6
|
+
};
|
5
7
|
parserOptions = {
|
6
8
|
parser: null,
|
7
9
|
project: "tsconfig.json",
|
8
10
|
sourceType: "module",
|
9
11
|
ecmaVersion: 2023,
|
10
12
|
};
|
11
|
-
|
13
|
+
processor = {};
|
14
|
+
language = {};
|
12
15
|
}
|
13
16
|
//# sourceMappingURL=ts.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ts.js","sourceRoot":"","sources":["../../../src/factory/scopes/ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,
|
1
|
+
{"version":3,"file":"ts.js","sourceRoot":"","sources":["../../../src/factory/scopes/ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,aAAmB;IACzC,eAAe,GAAG;QAChC,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,IAAI;KACL,CAAC;IACK,aAAa,GAAG;QAC9B,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,eAAe;QACxB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,IAAI;KACT,CAAC;IACK,SAAS,GAAG,EAAW,CAAC;IACxB,QAAQ,GAAG,EAAW,CAAC;CACxC"}
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest/index.js";
|
2
2
|
export default class YmlManifest extends ScopeManifest<"yml"> {
|
3
|
-
readonly processor: {};
|
4
|
-
readonly language: {};
|
5
|
-
readonly parserOptions: {
|
6
|
-
readonly parser: null;
|
7
|
-
};
|
8
3
|
readonly languageOptions: {
|
9
4
|
readonly parser: "yml";
|
5
|
+
readonly globals: null;
|
10
6
|
};
|
7
|
+
readonly parserOptions: {
|
8
|
+
readonly parser: null;
|
9
|
+
};
|
10
|
+
readonly processor: {};
|
11
|
+
readonly language: {};
|
11
12
|
}
|
12
13
|
//# sourceMappingURL=yml.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"yml.d.ts","sourceRoot":"","sources":["../../../src/factory/scopes/yml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,aAAa,
|
1
|
+
{"version":3,"file":"yml.d.ts","sourceRoot":"","sources":["../../../src/factory/scopes/yml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,aAAa,CAAC,KAAK,CAAC;IAC3D,SAAgB,eAAe;;;MAGpB;IACX,SAAgB,aAAa;;MAA6B;IAC1D,SAAgB,SAAS,KAAe;IACxC,SAAgB,QAAQ,KAAe;CACxC"}
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest/index.js";
|
2
2
|
export default class YmlManifest extends ScopeManifest {
|
3
|
+
languageOptions = {
|
4
|
+
parser: "yml",
|
5
|
+
globals: null,
|
6
|
+
};
|
7
|
+
parserOptions = { parser: null };
|
3
8
|
processor = {};
|
4
9
|
language = {};
|
5
|
-
parserOptions = { parser: null };
|
6
|
-
languageOptions = { parser: "yml" };
|
7
10
|
}
|
8
11
|
//# sourceMappingURL=yml.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"yml.js","sourceRoot":"","sources":["../../../src/factory/scopes/yml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,
|
1
|
+
{"version":3,"file":"yml.js","sourceRoot":"","sources":["../../../src/factory/scopes/yml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,aAAoB;IAC3C,eAAe,GAAG;QAChC,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,IAAI;KACL,CAAC;IACK,aAAa,GAAG,EAAE,MAAM,EAAE,IAAI,EAAW,CAAC;IAC1C,SAAS,GAAG,EAAW,CAAC;IACxB,QAAQ,GAAG,EAAW,CAAC;CACxC"}
|
package/package.json
CHANGED
package/src/factory/index.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import globals from "globals";
|
1
2
|
import { ScopeManifests } from "./manifests";
|
2
3
|
import type { Input } from "../interface";
|
3
4
|
import type { tree as Tree } from "../scopes";
|
@@ -15,14 +16,17 @@ export class Factory {
|
|
15
16
|
ignores: defaultIgnores,
|
16
17
|
rules: defaultRules,
|
17
18
|
}: Input["defaults"],
|
18
|
-
{
|
19
|
+
{
|
20
|
+
"*": commonExtension = {},
|
21
|
+
...scopeExtensions
|
22
|
+
}: Input["extensions"] = {} as const,
|
19
23
|
) {
|
20
24
|
const {
|
21
25
|
noInlineConfig = defaultSettings.noInlineConfig,
|
22
26
|
reportUnusedDisableDirectives = defaultSettings.reportUnusedDisableDirectives,
|
23
27
|
sourceType = defaultSettings.sourceType,
|
24
28
|
ecmaVersion = defaultSettings.ecmaVersion,
|
25
|
-
ignores = []
|
29
|
+
ignores = [],
|
26
30
|
override = false,
|
27
31
|
} = commonExtension;
|
28
32
|
|
@@ -35,7 +39,7 @@ export class Factory {
|
|
35
39
|
ignores: {
|
36
40
|
name: "linted/*/ignores/",
|
37
41
|
ignores: [
|
38
|
-
...override ? []
|
42
|
+
...override ? [] : defaultIgnores["*"],
|
39
43
|
...ignores,
|
40
44
|
] as const,
|
41
45
|
} as const,
|
@@ -59,7 +63,7 @@ export class Factory {
|
|
59
63
|
this.scopes.ignores[scope as keyof typeof scopeExtensions].push(...moreIgnores);
|
60
64
|
|
61
65
|
if (moreRules !== null)
|
62
|
-
this.scopes.rules[scope as keyof typeof scopeExtensions].push([`${scope}/override`, moreRules]);
|
66
|
+
this.scopes.rules[scope as keyof typeof scopeExtensions].push([`${scope}/override`, moreRules] as const);
|
63
67
|
}
|
64
68
|
|
65
69
|
tree.forEach(([scope, parents]) => {
|
@@ -82,16 +86,17 @@ export class Factory {
|
|
82
86
|
} = this.scopes,
|
83
87
|
ruleset = rules.map(([id, rules]) => ({ id: `${scope}/${id}`, rules } as const)),
|
84
88
|
{
|
85
|
-
processor,
|
86
|
-
language,
|
87
89
|
languageOptions: {
|
88
90
|
parser = null,
|
91
|
+
globals: global = null,
|
89
92
|
...languageOptionsStatic
|
90
93
|
},
|
91
94
|
parserOptions: {
|
92
95
|
parser: subparser = null,
|
93
96
|
...parserOptionsStatic
|
94
97
|
},
|
98
|
+
processor,
|
99
|
+
language,
|
95
100
|
} = new ScopeManifests[scope]();
|
96
101
|
|
97
102
|
return files.length < 1
|
@@ -103,10 +108,9 @@ export class Factory {
|
|
103
108
|
name: `linted/${scope}/`,
|
104
109
|
files,
|
105
110
|
ignores,
|
106
|
-
...processor,
|
107
|
-
...language,
|
108
111
|
languageOptions: {
|
109
112
|
...languageOptionsStatic,
|
113
|
+
...global !== null && global in globals ? { globals: globals[global as keyof typeof globals] } as const : {} as const,
|
110
114
|
...parser === null ? {} as const : { parser: this.parsers[parser] } as const,
|
111
115
|
...Object.keys(parserOptionsStatic).length < 1 && subparser === null
|
112
116
|
? {} as const
|
@@ -117,6 +121,8 @@ export class Factory {
|
|
117
121
|
} as const,
|
118
122
|
} as const,
|
119
123
|
} as const,
|
124
|
+
...processor,
|
125
|
+
...language,
|
120
126
|
} as const,
|
121
127
|
...ruleset.map(({ id, rules }) => ({
|
122
128
|
name: `linted/${id}/`,
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
2
|
|
3
3
|
export default class HtmlManifest extends ScopeManifest<"html"> {
|
4
|
+
public readonly languageOptions = {
|
5
|
+
parser: "html",
|
6
|
+
globals: null,
|
7
|
+
} as const;
|
8
|
+
public readonly parserOptions = { parser: null } as const;
|
4
9
|
public readonly processor = {} as const;
|
5
10
|
public readonly language = {} as const;
|
6
|
-
public readonly parserOptions = { parser: null } as const;
|
7
|
-
public readonly languageOptions = { parser: "html" } as const;
|
8
11
|
}
|
package/src/factory/scopes/js.ts
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
2
|
|
3
3
|
export default class JsManifest extends ScopeManifest {
|
4
|
+
public readonly languageOptions = {
|
5
|
+
parser: null,
|
6
|
+
globals: null,
|
7
|
+
} as const;
|
8
|
+
public readonly parserOptions = { parser: null } as const;
|
4
9
|
public readonly processor = {} as const;
|
5
10
|
public readonly language = {} as const;
|
6
|
-
public readonly parserOptions = { parser: null } as const;
|
7
|
-
public readonly languageOptions = { parser: null } as const;
|
8
11
|
}
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
2
|
|
3
3
|
export default class JsonManifest extends ScopeManifest<"jsonc"> {
|
4
|
+
public readonly languageOptions = {
|
5
|
+
parser: "jsonc",
|
6
|
+
globals: null,
|
7
|
+
} as const;
|
8
|
+
public readonly parserOptions = { parser: null } as const;
|
4
9
|
public readonly processor = {} as const;
|
5
10
|
public readonly language = {} as const;
|
6
|
-
public readonly parserOptions = { parser: null } as const;
|
7
|
-
public readonly languageOptions = { parser: "jsonc" } as const;
|
8
11
|
}
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
2
|
|
3
3
|
export default class JsoncManifest extends ScopeManifest<"jsonc"> {
|
4
|
+
public readonly languageOptions = {
|
5
|
+
parser: "jsonc",
|
6
|
+
globals: null,
|
7
|
+
} as const;
|
8
|
+
public readonly parserOptions = { parser: null } as const;
|
4
9
|
public readonly processor = {} as const;
|
5
10
|
public readonly language = {} as const;
|
6
|
-
public readonly parserOptions = { parser: null } as const;
|
7
|
-
public readonly languageOptions = { parser: "jsonc" } as const;
|
8
11
|
}
|
@@ -1,58 +1,16 @@
|
|
1
|
-
import globals from "globals";
|
1
|
+
import type globals from "globals";
|
2
2
|
import type { Parsers } from "../../../scopes";
|
3
3
|
|
4
|
-
export abstract class ScopeManifest<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
Processor extends object = object,
|
9
|
-
Language extends object = object,
|
10
|
-
> {
|
11
|
-
public abstract readonly processor: (Processor extends { readonly processor: infer P }
|
12
|
-
? string extends P
|
13
|
-
? Record<string, never>
|
14
|
-
: { readonly processor: P }
|
15
|
-
: Record<string, never>);
|
16
|
-
public abstract readonly language: (Language extends { readonly language: infer L }
|
17
|
-
? string extends L
|
18
|
-
? Record<string, never>
|
19
|
-
: { readonly language: L }
|
20
|
-
: Record<string, never>);
|
21
|
-
public abstract readonly parserOptions: (ParserOptions extends { readonly parser: infer P }
|
22
|
-
? P extends Parser
|
23
|
-
? ParserOptions
|
24
|
-
: (Omit<ParserOptions, "parser"> & { readonly parser: null })
|
25
|
-
: ParserOptions & { readonly parser: null });
|
4
|
+
export abstract class ScopeManifest<Parser extends Parsers | false = false> {
|
5
|
+
public abstract readonly processor: { readonly processor: string } | Record<string, never>;
|
6
|
+
public abstract readonly language: { readonly language: string } | Record<string, never>;
|
7
|
+
public abstract readonly parserOptions: object & { readonly parser: null | Exclude<Parser, boolean> };
|
26
8
|
public abstract readonly languageOptions: (
|
27
9
|
[Parser] extends [boolean]
|
28
10
|
? { readonly parser: null }
|
29
11
|
: { readonly parser: Parser }
|
30
12
|
|
31
13
|
) & (
|
32
|
-
|
33
|
-
? { readonly globals?: never }
|
34
|
-
: { readonly globals: Readonly<Record<string, unknown>> }
|
14
|
+
{ readonly globals: null | keyof typeof globals }
|
35
15
|
);
|
36
|
-
|
37
|
-
public get option() {
|
38
|
-
const {
|
39
|
-
languageOptions, parserOptions, processor, language,
|
40
|
-
} = this;
|
41
|
-
|
42
|
-
return {
|
43
|
-
languageOptions: {
|
44
|
-
...languageOptions,
|
45
|
-
...parserOptions,
|
46
|
-
},
|
47
|
-
...processor,
|
48
|
-
...language,
|
49
|
-
} as const;
|
50
|
-
}
|
51
|
-
|
52
|
-
protected globals(global: Global & keyof typeof globals) {
|
53
|
-
if (typeof global === "boolean")
|
54
|
-
throw new TypeError("`global` must be a string key of `globals` package");
|
55
|
-
|
56
|
-
return globals[global];
|
57
|
-
}
|
58
16
|
}
|
@@ -1,22 +1,16 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
|
-
import type TsManifest from "./ts";
|
3
2
|
|
4
|
-
export default class MochaManifest extends ScopeManifest<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
public readonly processor = {} as const;
|
10
|
-
public readonly language = {} as const;
|
11
|
-
public readonly types = ["mocha"] as const;
|
3
|
+
export default class MochaManifest extends ScopeManifest<"ts"> {
|
4
|
+
public readonly languageOptions = {
|
5
|
+
parser: "ts",
|
6
|
+
globals: "mocha",
|
7
|
+
} as const;
|
12
8
|
public readonly parserOptions = {
|
13
9
|
parser: null,
|
14
10
|
project: "tsconfig.json",
|
15
11
|
sourceType: "module",
|
16
12
|
ecmaVersion: 2023,
|
17
13
|
} as const;
|
18
|
-
public readonly
|
19
|
-
|
20
|
-
globals: this.globals("mocha"),
|
21
|
-
} as const;
|
14
|
+
public readonly processor = {} as const;
|
15
|
+
public readonly language = {} as const;
|
22
16
|
}
|
@@ -1,17 +1,10 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
|
-
import type TsManifest from "./ts";
|
3
2
|
|
4
|
-
export default class SvelteManifest extends ScopeManifest<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
},
|
10
|
-
false,
|
11
|
-
{ readonly processor: "svelte/svelte" }
|
12
|
-
> {
|
13
|
-
public readonly processor = { processor: "svelte/svelte" } as const;
|
14
|
-
public readonly language = {} as const;
|
3
|
+
export default class SvelteManifest extends ScopeManifest<"svelte" | "ts"> {
|
4
|
+
public readonly languageOptions = {
|
5
|
+
parser: "svelte",
|
6
|
+
globals: null,
|
7
|
+
} as const;
|
15
8
|
public readonly parserOptions = {
|
16
9
|
parser: "ts",
|
17
10
|
extraFileExtensions: [".svelte"] as const,
|
@@ -19,5 +12,6 @@ export default class SvelteManifest extends ScopeManifest<
|
|
19
12
|
sourceType: "module",
|
20
13
|
ecmaVersion: 2023,
|
21
14
|
} as const;
|
22
|
-
public readonly
|
15
|
+
public readonly processor = { processor: "svelte/svelte" } as const;
|
16
|
+
public readonly language = {} as const;
|
23
17
|
}
|
package/src/factory/scopes/ts.ts
CHANGED
@@ -1,20 +1,16 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
2
|
|
3
|
-
export default class TsManifest extends ScopeManifest<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
readonly ecmaVersion: 2023;
|
9
|
-
}
|
10
|
-
> {
|
11
|
-
public readonly processor = {} as const;
|
12
|
-
public readonly language = {} as const;
|
3
|
+
export default class TsManifest extends ScopeManifest<"ts"> {
|
4
|
+
public readonly languageOptions = {
|
5
|
+
parser: "ts",
|
6
|
+
globals: null,
|
7
|
+
} as const;
|
13
8
|
public readonly parserOptions = {
|
14
9
|
parser: null,
|
15
10
|
project: "tsconfig.json",
|
16
11
|
sourceType: "module",
|
17
12
|
ecmaVersion: 2023,
|
18
13
|
} as const;
|
19
|
-
public readonly
|
14
|
+
public readonly processor = {} as const;
|
15
|
+
public readonly language = {} as const;
|
20
16
|
}
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { ScopeManifest } from "./manifest";
|
2
2
|
|
3
|
-
export default class YmlManifest extends ScopeManifest<
|
4
|
-
|
5
|
-
|
3
|
+
export default class YmlManifest extends ScopeManifest<"yml"> {
|
4
|
+
public readonly languageOptions = {
|
5
|
+
parser: "yml",
|
6
|
+
globals: null,
|
7
|
+
} as const;
|
8
|
+
public readonly parserOptions = { parser: null } as const;
|
6
9
|
public readonly processor = {} as const;
|
7
10
|
public readonly language = {} as const;
|
8
|
-
public readonly parserOptions = { parser: null } as const;
|
9
|
-
public readonly languageOptions = { parser: "yml" } as const;
|
10
11
|
}
|