eslint-plugin-complete 1.0.4 → 1.0.5
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-mutable-return.d.ts","sourceRoot":"","sources":["../../src/rules/no-mutable-return.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-mutable-return.d.ts","sourceRoot":"","sources":["../../src/rules/no-mutable-return.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMvD,KAAK,UAAU,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAE/D,eAAO,MAAM,eAAe,wHA6C1B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isTypeReferenceType } from "@typescript-eslint/type-utils";
|
|
1
2
|
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
2
3
|
import { getTypeName, unionTypeParts } from "../typeUtils.js";
|
|
3
4
|
import { createRule } from "../utils.js";
|
|
@@ -47,6 +48,15 @@ function getErrorMessageId(type) {
|
|
|
47
48
|
if (typeName === undefined) {
|
|
48
49
|
return undefined;
|
|
49
50
|
}
|
|
51
|
+
// Handle unwrapping promises.
|
|
52
|
+
if (typeName === "Promise" &&
|
|
53
|
+
isTypeReferenceType(type) &&
|
|
54
|
+
type.typeArguments !== undefined) {
|
|
55
|
+
const typeArgument = type.typeArguments[0];
|
|
56
|
+
if (typeArgument !== undefined) {
|
|
57
|
+
return getErrorMessageId(typeArgument);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
50
60
|
// This would be "ReadonlyMap" if it was the read-only version.
|
|
51
61
|
if (typeName === "Map") {
|
|
52
62
|
return "mutableMap";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-complete",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "An ESLint plugin that contains useful rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"test": "jest"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@typescript-eslint/type-utils": "^8.
|
|
48
|
-
"@typescript-eslint/utils": "^8.
|
|
49
|
-
"typescript-eslint": "^8.
|
|
47
|
+
"@typescript-eslint/type-utils": "^8.8.0",
|
|
48
|
+
"@typescript-eslint/utils": "^8.8.0",
|
|
49
|
+
"typescript-eslint": "^8.8.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@babel/core": "^7.25.2",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@babel/preset-typescript": "^7.24.7",
|
|
55
55
|
"@types/jest": "^29.5.13",
|
|
56
56
|
"@types/node": "^22.7.4",
|
|
57
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
58
|
-
"@typescript-eslint/types": "^8.
|
|
57
|
+
"@typescript-eslint/rule-tester": "^8.8.0",
|
|
58
|
+
"@typescript-eslint/types": "^8.8.0",
|
|
59
59
|
"complete-common": "^1.0.0",
|
|
60
60
|
"complete-node": "^1.5.1",
|
|
61
61
|
"jest": "^29.7.0",
|