@typescript-eslint/eslint-plugin 8.70.1-alpha.25 → 8.70.1-alpha.26
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.
|
@@ -841,19 +841,23 @@ function hasWellKnownSymbolWithVoidReturn(checker, node, type, symbolName) {
|
|
|
841
841
|
function hasMatchingPromiseTypeArgument(checker, node) {
|
|
842
842
|
const type = checker.getTypeAtLocation(node);
|
|
843
843
|
const unionConstituents = tsutils.unionConstituents(checker.getApparentType(type));
|
|
844
|
-
const
|
|
845
|
-
if (
|
|
844
|
+
const promiseTypes = unionConstituents.filter(type => tsutils.isThenableType(checker, node, type));
|
|
845
|
+
if (promiseTypes.length === 0) {
|
|
846
846
|
return false;
|
|
847
847
|
}
|
|
848
|
-
const nonPromiseUnionConstituents = unionConstituents.filter(type => type
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
|
|
848
|
+
const nonPromiseUnionConstituents = unionConstituents.filter(type => !promiseTypes.includes(type));
|
|
849
|
+
const awaitedTypeConstituents = [];
|
|
850
|
+
for (const promiseType of promiseTypes) {
|
|
851
|
+
const awaitedType = checker.getAwaitedType(promiseType);
|
|
852
|
+
if (!awaitedType) {
|
|
853
|
+
return false;
|
|
854
|
+
}
|
|
855
|
+
awaitedTypeConstituents.push(...tsutils.unionConstituents(awaitedType));
|
|
852
856
|
}
|
|
853
|
-
const
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
+
const typesAreEquivalent = (left, right) => checker.isTypeAssignableTo(left, right) &&
|
|
858
|
+
checker.isTypeAssignableTo(right, left);
|
|
859
|
+
return (nonPromiseUnionConstituents.every(type => awaitedTypeConstituents.some(awaited => typesAreEquivalent(type, awaited))) &&
|
|
860
|
+
awaitedTypeConstituents.every(awaited => nonPromiseUnionConstituents.some(type => typesAreEquivalent(type, awaited))));
|
|
857
861
|
}
|
|
858
862
|
function normalizeFlagUnionsOption(checksConditionals) {
|
|
859
863
|
if (!checksConditionals || checksConditionals === true) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/eslint-plugin",
|
|
3
|
-
"version": "8.70.1-alpha.
|
|
3
|
+
"version": "8.70.1-alpha.26",
|
|
4
4
|
"description": "TypeScript plugin for ESLint",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@eslint-community/regexpp": "^4.12.2",
|
|
50
|
-
"@typescript-eslint/scope-manager": "8.70.1-alpha.
|
|
51
|
-
"@typescript-eslint/type-utils": "8.70.1-alpha.
|
|
52
|
-
"@typescript-eslint/utils": "8.70.1-alpha.
|
|
53
|
-
"@typescript-eslint/visitor-keys": "8.70.1-alpha.
|
|
50
|
+
"@typescript-eslint/scope-manager": "8.70.1-alpha.26",
|
|
51
|
+
"@typescript-eslint/type-utils": "8.70.1-alpha.26",
|
|
52
|
+
"@typescript-eslint/utils": "8.70.1-alpha.26",
|
|
53
|
+
"@typescript-eslint/visitor-keys": "8.70.1-alpha.26",
|
|
54
54
|
"ignore": "^7.0.5",
|
|
55
55
|
"natural-compare": "^1.4.0",
|
|
56
56
|
"ts-api-utils": "^2.5.0"
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@types/mdast": "^4.0.4",
|
|
61
61
|
"@types/natural-compare": "^1.4.3",
|
|
62
62
|
"@types/react": "^18.3.21",
|
|
63
|
-
"@typescript-eslint/rule-schema-to-typescript-types": "8.70.1-alpha.
|
|
64
|
-
"@typescript-eslint/rule-tester": "8.70.1-alpha.
|
|
63
|
+
"@typescript-eslint/rule-schema-to-typescript-types": "8.70.1-alpha.26",
|
|
64
|
+
"@typescript-eslint/rule-tester": "8.70.1-alpha.26",
|
|
65
65
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
66
66
|
"@vitest/coverage-v8": "^4.0.18",
|
|
67
67
|
"ajv": "^6.12.6",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"vitest": "^4.0.18"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@typescript-eslint/parser": "^8.70.1-alpha.
|
|
84
|
+
"@typescript-eslint/parser": "^8.70.1-alpha.26",
|
|
85
85
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
|
86
86
|
"typescript": ">=4.8.4 <6.1.0"
|
|
87
87
|
},
|