@typescript-eslint/type-utils 8.53.2-alpha.8 → 8.54.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.
|
@@ -152,7 +152,7 @@ function isBuiltinSymbolLikeRecurser(program, type, predicate) {
|
|
|
152
152
|
}
|
|
153
153
|
const symbol = type.getSymbol();
|
|
154
154
|
if (symbol &&
|
|
155
|
-
symbol
|
|
155
|
+
tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Class | ts.SymbolFlags.Interface)) {
|
|
156
156
|
const checker = program.getTypeChecker();
|
|
157
157
|
for (const baseType of checker.getBaseTypes(type)) {
|
|
158
158
|
if (isBuiltinSymbolLikeRecurser(program, baseType, predicate)) {
|
package/dist/getTypeName.js
CHANGED
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.getTypeName = getTypeName;
|
|
37
|
+
const tsutils = __importStar(require("ts-api-utils"));
|
|
37
38
|
const ts = __importStar(require("typescript"));
|
|
38
39
|
/**
|
|
39
40
|
* Get the type name of a given type.
|
|
@@ -42,13 +43,13 @@ const ts = __importStar(require("typescript"));
|
|
|
42
43
|
*/
|
|
43
44
|
function getTypeName(typeChecker, type) {
|
|
44
45
|
// It handles `string` and string literal types as string.
|
|
45
|
-
if ((type
|
|
46
|
+
if (tsutils.isTypeFlagSet(type, ts.TypeFlags.StringLike)) {
|
|
46
47
|
return 'string';
|
|
47
48
|
}
|
|
48
49
|
// If the type is a type parameter which extends primitive string types,
|
|
49
50
|
// but it was not recognized as a string like. So check the constraint
|
|
50
51
|
// type of the type parameter.
|
|
51
|
-
if ((type
|
|
52
|
+
if (tsutils.isTypeFlagSet(type, ts.TypeFlags.TypeParameter)) {
|
|
52
53
|
// `type.getConstraint()` method doesn't return the constraint type of
|
|
53
54
|
// the type parameter for some reason. So this gets the constraint type
|
|
54
55
|
// via AST.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/type-utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.54.0",
|
|
4
4
|
"description": "Type utilities for working with TypeScript + ESLint together",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"typecheck": "yarn run -BT nx typecheck"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@typescript-eslint/types": "8.
|
|
48
|
-
"@typescript-eslint/typescript-estree": "8.
|
|
49
|
-
"@typescript-eslint/utils": "8.
|
|
47
|
+
"@typescript-eslint/types": "8.54.0",
|
|
48
|
+
"@typescript-eslint/typescript-estree": "8.54.0",
|
|
49
|
+
"@typescript-eslint/utils": "8.54.0",
|
|
50
50
|
"debug": "^4.4.3",
|
|
51
51
|
"ts-api-utils": "^2.4.0"
|
|
52
52
|
},
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"typescript": ">=4.8.4 <6.0.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@typescript-eslint/parser": "8.
|
|
58
|
+
"@typescript-eslint/parser": "8.54.0",
|
|
59
59
|
"@vitest/coverage-v8": "^3.2.4",
|
|
60
60
|
"ajv": "^6.12.6",
|
|
61
61
|
"eslint": "*",
|