@typescript-eslint/eslint-plugin 8.59.0 → 8.59.1-alpha.1
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.
|
@@ -220,6 +220,11 @@ exports.default = (0, util_1.createRule)({
|
|
|
220
220
|
function hasIndexSignature(type) {
|
|
221
221
|
return checker.getIndexInfosOfType(type).length > 0;
|
|
222
222
|
}
|
|
223
|
+
function getTypeArguments(type) {
|
|
224
|
+
return tsutils.isTypeReference(type)
|
|
225
|
+
? checker.getTypeArguments(type)
|
|
226
|
+
: [];
|
|
227
|
+
}
|
|
223
228
|
function typeContains(type, predicate, seen = new Set()) {
|
|
224
229
|
if (seen.has(type)) {
|
|
225
230
|
return false;
|
|
@@ -232,7 +237,7 @@ exports.default = (0, util_1.createRule)({
|
|
|
232
237
|
return type.types.some(t => typeContains(t, predicate, seen));
|
|
233
238
|
}
|
|
234
239
|
const nestedTypes = [
|
|
235
|
-
...
|
|
240
|
+
...getTypeArguments(type),
|
|
236
241
|
...type
|
|
237
242
|
.getCallSignatures()
|
|
238
243
|
.flatMap(sig => [
|
|
@@ -281,8 +286,8 @@ exports.default = (0, util_1.createRule)({
|
|
|
281
286
|
});
|
|
282
287
|
}
|
|
283
288
|
function haveSameTypeArguments(uncast, cast) {
|
|
284
|
-
const uncastArgs =
|
|
285
|
-
const castArgs =
|
|
289
|
+
const uncastArgs = getTypeArguments(uncast);
|
|
290
|
+
const castArgs = getTypeArguments(cast);
|
|
286
291
|
return (uncastArgs.length === castArgs.length &&
|
|
287
292
|
uncastArgs.every((arg, i) => arg === castArgs[i]));
|
|
288
293
|
}
|
|
@@ -385,7 +390,7 @@ exports.default = (0, util_1.createRule)({
|
|
|
385
390
|
if (param.valueDeclaration &&
|
|
386
391
|
ts.isParameter(param.valueDeclaration) &&
|
|
387
392
|
param.valueDeclaration.dotDotDotToken) {
|
|
388
|
-
const typeArgs =
|
|
393
|
+
const typeArgs = getTypeArguments(paramType);
|
|
389
394
|
if (typeArgs.length > 0) {
|
|
390
395
|
paramType = typeArgs[0];
|
|
391
396
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/eslint-plugin",
|
|
3
|
-
"version": "8.59.
|
|
3
|
+
"version": "8.59.1-alpha.1",
|
|
4
4
|
"description": "TypeScript plugin for ESLint",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"ignore": "^7.0.5",
|
|
53
53
|
"natural-compare": "^1.4.0",
|
|
54
54
|
"ts-api-utils": "^2.5.0",
|
|
55
|
-
"@typescript-eslint/scope-manager": "8.59.
|
|
56
|
-
"@typescript-eslint/type-utils": "8.59.
|
|
57
|
-
"@typescript-eslint/
|
|
58
|
-
"@typescript-eslint/
|
|
55
|
+
"@typescript-eslint/scope-manager": "8.59.1-alpha.1",
|
|
56
|
+
"@typescript-eslint/type-utils": "8.59.1-alpha.1",
|
|
57
|
+
"@typescript-eslint/visitor-keys": "8.59.1-alpha.1",
|
|
58
|
+
"@typescript-eslint/utils": "8.59.1-alpha.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/json-schema": "^7.0.15",
|
|
@@ -78,13 +78,13 @@
|
|
|
78
78
|
"typescript": ">=4.8.4 <6.1.0",
|
|
79
79
|
"unist-util-visit": "^5.0.0",
|
|
80
80
|
"vitest": "^4.0.18",
|
|
81
|
-
"@typescript-eslint/rule-schema-to-typescript-types": "8.59.
|
|
82
|
-
"@typescript-eslint/rule-tester": "8.59.
|
|
81
|
+
"@typescript-eslint/rule-schema-to-typescript-types": "8.59.1-alpha.1",
|
|
82
|
+
"@typescript-eslint/rule-tester": "8.59.1-alpha.1"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
|
86
86
|
"typescript": ">=4.8.4 <6.1.0",
|
|
87
|
-
"@typescript-eslint/parser": "^8.59.
|
|
87
|
+
"@typescript-eslint/parser": "^8.59.1-alpha.1"
|
|
88
88
|
},
|
|
89
89
|
"funding": {
|
|
90
90
|
"type": "opencollective",
|