@typescript-eslint/type-utils 8.18.3-alpha.5 → 8.19.0
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.
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/typescript-estree';
|
|
2
2
|
import type * as ts from 'typescript';
|
|
3
3
|
/**
|
|
4
|
-
* Resolves the given node's type. Will
|
|
4
|
+
* Resolves the given node's type. Will return the type's generic constraint, if it has one.
|
|
5
|
+
*
|
|
6
|
+
* Warning - if the type is generic and does _not_ have a constraint, the type will be
|
|
7
|
+
* returned as-is, rather than returning an `unknown` type. This can be checked
|
|
8
|
+
* for by checking for the type flag ts.TypeFlags.TypeParameter.
|
|
9
|
+
*
|
|
10
|
+
* @see https://github.com/typescript-eslint/typescript-eslint/issues/10438
|
|
5
11
|
*/
|
|
6
12
|
export declare function getConstrainedTypeAtLocation(services: ParserServicesWithTypeInformation, node: TSESTree.Node): ts.Type;
|
|
7
13
|
//# sourceMappingURL=getConstrainedTypeAtLocation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConstrainedTypeAtLocation.d.ts","sourceRoot":"","sources":["../src/getConstrainedTypeAtLocation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,QAAQ,EACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"getConstrainedTypeAtLocation.d.ts","sourceRoot":"","sources":["../src/getConstrainedTypeAtLocation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,QAAQ,EACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,iCAAiC,EAC3C,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,EAAE,CAAC,IAAI,CAOT"}
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getConstrainedTypeAtLocation = getConstrainedTypeAtLocation;
|
|
4
4
|
/**
|
|
5
|
-
* Resolves the given node's type. Will
|
|
5
|
+
* Resolves the given node's type. Will return the type's generic constraint, if it has one.
|
|
6
|
+
*
|
|
7
|
+
* Warning - if the type is generic and does _not_ have a constraint, the type will be
|
|
8
|
+
* returned as-is, rather than returning an `unknown` type. This can be checked
|
|
9
|
+
* for by checking for the type flag ts.TypeFlags.TypeParameter.
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/typescript-eslint/typescript-eslint/issues/10438
|
|
6
12
|
*/
|
|
7
13
|
function getConstrainedTypeAtLocation(services, node) {
|
|
8
14
|
const nodeType = services.getTypeAtLocation(node);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConstrainedTypeAtLocation.js","sourceRoot":"","sources":["../src/getConstrainedTypeAtLocation.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getConstrainedTypeAtLocation.js","sourceRoot":"","sources":["../src/getConstrainedTypeAtLocation.ts"],"names":[],"mappings":";;AAeA,oEAUC;AAnBD;;;;;;;;GAQG;AACH,SAAgB,4BAA4B,CAC1C,QAA2C,EAC3C,IAAmB;IAEnB,MAAM,QAAQ,GAAG,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO;SACjC,cAAc,EAAE;SAChB,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAErC,OAAO,WAAW,IAAI,QAAQ,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/type-utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.19.0",
|
|
4
4
|
"description": "Type utilities for working with TypeScript + ESLint together",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"typecheck": "tsc --noEmit"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@typescript-eslint/typescript-estree": "8.
|
|
50
|
-
"@typescript-eslint/utils": "8.
|
|
49
|
+
"@typescript-eslint/typescript-estree": "8.19.0",
|
|
50
|
+
"@typescript-eslint/utils": "8.19.0",
|
|
51
51
|
"debug": "^4.3.4",
|
|
52
52
|
"ts-api-utils": "^1.3.0"
|
|
53
53
|
},
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@jest/types": "29.6.3",
|
|
60
|
-
"@typescript-eslint/parser": "8.
|
|
60
|
+
"@typescript-eslint/parser": "8.19.0",
|
|
61
61
|
"ajv": "^6.12.6",
|
|
62
62
|
"downlevel-dts": "*",
|
|
63
63
|
"jest": "29.7.0",
|