typescript-eslint 8.14.1-alpha.4 → 8.14.1-alpha.6
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/config-helper.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
export type InfiniteDepthConfigWithExtends = ConfigWithExtends | InfiniteDepthConfigWithExtends[];
|
|
2
3
|
export interface ConfigWithExtends extends TSESLint.FlatConfig.Config {
|
|
3
4
|
/**
|
|
4
5
|
* Allows you to "extend" a set of configs similar to `extends` from the
|
|
@@ -40,7 +41,7 @@ export interface ConfigWithExtends extends TSESLint.FlatConfig.Config {
|
|
|
40
41
|
* ]
|
|
41
42
|
* ```
|
|
42
43
|
*/
|
|
43
|
-
extends?:
|
|
44
|
+
extends?: InfiniteDepthConfigWithExtends[];
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
46
47
|
* Utility function to make it easy to strictly type your "Flat" config file
|
|
@@ -62,5 +63,5 @@ export interface ConfigWithExtends extends TSESLint.FlatConfig.Config {
|
|
|
62
63
|
* );
|
|
63
64
|
* ```
|
|
64
65
|
*/
|
|
65
|
-
export declare function config(...configs:
|
|
66
|
+
export declare function config(...configs: InfiniteDepthConfigWithExtends[]): TSESLint.FlatConfig.ConfigArray;
|
|
66
67
|
//# sourceMappingURL=config-helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-helper.d.ts","sourceRoot":"","sources":["../src/config-helper.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CAAC,UAAU,CAAC,MAAM;IACnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,OAAO,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"config-helper.d.ts","sourceRoot":"","sources":["../src/config-helper.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,MAAM,8BAA8B,GACtC,iBAAiB,GACjB,8BAA8B,EAAE,CAAC;AAErC,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CAAC,UAAU,CAAC,MAAM;IACnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACpB,GAAG,OAAO,EAAE,8BAA8B,EAAE,GAC3C,QAAQ,CAAC,UAAU,CAAC,WAAW,CAkDjC"}
|
package/dist/config-helper.js
CHANGED
|
@@ -22,12 +22,16 @@ exports.config = config;
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
function config(...configs) {
|
|
25
|
-
|
|
25
|
+
const flattened =
|
|
26
|
+
// @ts-expect-error -- intentionally an infinite type
|
|
27
|
+
configs.flat(Infinity);
|
|
28
|
+
return flattened.flatMap((configWithExtends, configIndex) => {
|
|
26
29
|
const { extends: extendsArr, ...config } = configWithExtends;
|
|
27
30
|
if (extendsArr == null || extendsArr.length === 0) {
|
|
28
31
|
return config;
|
|
29
32
|
}
|
|
30
|
-
const
|
|
33
|
+
const extendsArrFlattened = extendsArr.flat(Infinity);
|
|
34
|
+
const undefinedExtensions = extendsArrFlattened.reduce((acc, extension, extensionIndex) => {
|
|
31
35
|
const maybeExtension = extension;
|
|
32
36
|
if (maybeExtension == null) {
|
|
33
37
|
acc.push(extensionIndex);
|
|
@@ -43,7 +47,7 @@ function config(...configs) {
|
|
|
43
47
|
` extensions at the following indices: ${extensionIndices}.`);
|
|
44
48
|
}
|
|
45
49
|
return [
|
|
46
|
-
...
|
|
50
|
+
...extendsArrFlattened.map(extension => {
|
|
47
51
|
const name = [config.name, extension.name].filter(Boolean).join('__');
|
|
48
52
|
return {
|
|
49
53
|
...extension,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-helper.js","sourceRoot":"","sources":["../src/config-helper.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"config-helper.js","sourceRoot":"","sources":["../src/config-helper.ts"],"names":[],"mappings":";;AAwFA,wBAoDC;AAxED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,MAAM,CACpB,GAAG,OAAyC;IAE5C,MAAM,SAAS;IACb,qDAAqD;IACrD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAwB,CAAC;IAChD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC,iBAAiB,EAAE,WAAW,EAAE,EAAE;QAC1D,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,GAAG,iBAAiB,CAAC;QAC7D,IAAI,UAAU,IAAI,IAAI,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAClD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,mBAAmB,GAAG,UAAU,CAAC,IAAI,CACzC,QAAQ,CACc,CAAC;QAEzB,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,MAAM,CACpD,CAAC,GAAG,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE;YACjC,MAAM,cAAc,GAAG,SAEV,CAAC;YACd,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;gBAC3B,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC3B,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EACD,EAAE,CACH,CAAC;QACF,IAAI,mBAAmB,CAAC,MAAM,EAAE,CAAC;YAC/B,MAAM,UAAU,GACd,iBAAiB,CAAC,IAAI,IAAI,IAAI;gBAC5B,CAAC,CAAC,YAAY,iBAAiB,CAAC,IAAI,IAAI;gBACxC,CAAC,CAAC,cAAc,CAAC;YACrB,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxD,MAAM,IAAI,KAAK,CACb,wBAAwB,WAAW,GAAG,UAAU,qBAAqB;gBACnE,yCAAyC,gBAAgB,GAAG,CAC/D,CAAC;QACJ,CAAC;QAED,OAAO;YACL,GAAG,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;gBACrC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACtE,OAAO;oBACL,GAAG,SAAS;oBACZ,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;oBAC5C,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;oBAClD,GAAG,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,CAAC;iBACtB,CAAC;YACJ,CAAC,CAAC;YACF,MAAM;SACP,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typescript-eslint",
|
|
3
|
-
"version": "8.14.1-alpha.
|
|
3
|
+
"version": "8.14.1-alpha.6",
|
|
4
4
|
"description": "Tooling which enables you to use TypeScript with ESLint",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -52,9 +52,12 @@
|
|
|
52
52
|
"typecheck": "tsc --noEmit"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "8.14.1-alpha.
|
|
56
|
-
"@typescript-eslint/parser": "8.14.1-alpha.
|
|
57
|
-
"@typescript-eslint/utils": "8.14.1-alpha.
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "8.14.1-alpha.6",
|
|
56
|
+
"@typescript-eslint/parser": "8.14.1-alpha.6",
|
|
57
|
+
"@typescript-eslint/utils": "8.14.1-alpha.6"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"eslint": "^8.57.0 || ^9.0.0"
|
|
58
61
|
},
|
|
59
62
|
"devDependencies": {
|
|
60
63
|
"@jest/types": "29.6.3",
|