@typescript-eslint/type-utils 8.31.2-alpha.8 → 8.32.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.
|
@@ -162,7 +162,7 @@ function typeMatchesSpecifier(type, specifier, program) {
|
|
|
162
162
|
}
|
|
163
163
|
if (tsutils.isIntersectionType(type) &&
|
|
164
164
|
tsutils
|
|
165
|
-
.
|
|
165
|
+
.intersectionConstituents(type)
|
|
166
166
|
.some(part => typeMatchesSpecifier(part, specifier, program))) {
|
|
167
167
|
return true;
|
|
168
168
|
}
|
|
@@ -62,7 +62,7 @@ function discriminateAnyTypeWorker(type, checker, program, tsNode, visited) {
|
|
|
62
62
|
if ((0, predicates_1.isTypeAnyArrayType)(type, checker)) {
|
|
63
63
|
return AnyType.AnyArray;
|
|
64
64
|
}
|
|
65
|
-
for (const part of tsutils.
|
|
65
|
+
for (const part of tsutils.typeConstituents(type)) {
|
|
66
66
|
if (tsutils.isThenableType(checker, tsNode, part)) {
|
|
67
67
|
const awaitedType = checker.getAwaitedType(part);
|
|
68
68
|
if (awaitedType) {
|
package/dist/isTypeReadonly.js
CHANGED
|
@@ -182,7 +182,7 @@ function isTypeReadonlyRecurser(program, type, options, seenTypes) {
|
|
|
182
182
|
if (tsutils.isUnionType(type)) {
|
|
183
183
|
// all types in the union must be readonly
|
|
184
184
|
const result = tsutils
|
|
185
|
-
.
|
|
185
|
+
.unionConstituents(type)
|
|
186
186
|
.every(t => seenTypes.has(t) ||
|
|
187
187
|
isTypeReadonlyRecurser(program, t, options, seenTypes) ===
|
|
188
188
|
Readonlyness.Readonly);
|
package/dist/predicates.js
CHANGED
|
@@ -67,7 +67,7 @@ function isNullableType(type) {
|
|
|
67
67
|
* or a union made up solely of array types.
|
|
68
68
|
*/
|
|
69
69
|
function isTypeArrayTypeOrUnionOfArrayTypes(type, checker) {
|
|
70
|
-
for (const t of tsutils.
|
|
70
|
+
for (const t of tsutils.unionConstituents(type)) {
|
|
71
71
|
if (!checker.isArrayType(t)) {
|
|
72
72
|
return false;
|
|
73
73
|
}
|
package/dist/typeFlagUtils.js
CHANGED
|
@@ -44,7 +44,7 @@ const ANY_OR_UNKNOWN = ts.TypeFlags.Any | ts.TypeFlags.Unknown;
|
|
|
44
44
|
function getTypeFlags(type) {
|
|
45
45
|
// @ts-expect-error Since typescript 5.0, this is invalid, but uses 0 as the default value of TypeFlags.
|
|
46
46
|
let flags = 0;
|
|
47
|
-
for (const t of tsutils.
|
|
47
|
+
for (const t of tsutils.unionConstituents(type)) {
|
|
48
48
|
flags |= t.flags;
|
|
49
49
|
}
|
|
50
50
|
return flags;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/type-utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.32.0",
|
|
4
4
|
"description": "Type utilities for working with TypeScript + ESLint together",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -37,31 +37,31 @@
|
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsc -b tsconfig.build.json",
|
|
40
|
-
"clean": "
|
|
41
|
-
"postclean": "rimraf dist/ coverage/",
|
|
40
|
+
"clean": "rimraf dist/ coverage/",
|
|
42
41
|
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
|
|
43
42
|
"lint": "npx nx lint",
|
|
44
43
|
"test": "vitest --run --config=$INIT_CWD/vitest.config.mts",
|
|
45
44
|
"check-types": "npx nx typecheck"
|
|
46
45
|
},
|
|
47
46
|
"dependencies": {
|
|
48
|
-
"@typescript-eslint/typescript-estree": "8.
|
|
49
|
-
"@typescript-eslint/utils": "8.
|
|
47
|
+
"@typescript-eslint/typescript-estree": "8.32.0",
|
|
48
|
+
"@typescript-eslint/utils": "8.32.0",
|
|
50
49
|
"debug": "^4.3.4",
|
|
51
|
-
"ts-api-utils": "^2.0
|
|
50
|
+
"ts-api-utils": "^2.1.0"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
|
54
53
|
"eslint": "^8.57.0 || ^9.0.0",
|
|
55
54
|
"typescript": ">=4.8.4 <5.9.0"
|
|
56
55
|
},
|
|
57
56
|
"devDependencies": {
|
|
58
|
-
"@typescript-eslint/parser": "8.
|
|
59
|
-
"@vitest/coverage-v8": "^3.1.
|
|
57
|
+
"@typescript-eslint/parser": "8.32.0",
|
|
58
|
+
"@vitest/coverage-v8": "^3.1.2",
|
|
60
59
|
"ajv": "^6.12.6",
|
|
60
|
+
"eslint": "*",
|
|
61
61
|
"prettier": "^3.2.5",
|
|
62
62
|
"rimraf": "*",
|
|
63
63
|
"typescript": "*",
|
|
64
|
-
"vitest": "^3.1.
|
|
64
|
+
"vitest": "^3.1.2"
|
|
65
65
|
},
|
|
66
66
|
"funding": {
|
|
67
67
|
"type": "opencollective",
|