@typescript-eslint/eslint-plugin 6.6.1-alpha.10 → 6.6.1-alpha.12
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.
|
@@ -33,8 +33,10 @@ exports.default = util.createRule({
|
|
|
33
33
|
recommended: 'recommended',
|
|
34
34
|
requiresTypeChecking: true,
|
|
35
35
|
},
|
|
36
|
+
hasSuggestions: true,
|
|
36
37
|
messages: {
|
|
37
38
|
await: 'Unexpected `await` of a non-Promise (non-"Thenable") value.',
|
|
39
|
+
removeAwait: 'Remove unnecessary `await`.',
|
|
38
40
|
},
|
|
39
41
|
schema: [],
|
|
40
42
|
type: 'problem',
|
|
@@ -54,6 +56,16 @@ exports.default = util.createRule({
|
|
|
54
56
|
context.report({
|
|
55
57
|
messageId: 'await',
|
|
56
58
|
node,
|
|
59
|
+
suggest: [
|
|
60
|
+
{
|
|
61
|
+
messageId: 'removeAwait',
|
|
62
|
+
fix(fixer) {
|
|
63
|
+
const sourceCode = context.getSourceCode();
|
|
64
|
+
const awaitKeyword = util.nullThrows(sourceCode.getFirstToken(node, util.isAwaitKeyword), util.NullThrowsReasons.MissingToken('await', 'await expression'));
|
|
65
|
+
return fixer.remove(awaitKeyword);
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
],
|
|
57
69
|
});
|
|
58
70
|
}
|
|
59
71
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"await-thenable.js","sourceRoot":"","sources":["../../src/rules/await-thenable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"await-thenable.js","sourceRoot":"","sources":["../../src/rules/await-thenable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,sDAAwC;AAExC,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE;QACJ,IAAI,E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AAC;oCAEF,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gCACpC,CAAC;6BACF;yBACF;qBACF,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/eslint-plugin",
|
|
3
|
-
"version": "6.6.1-alpha.
|
|
3
|
+
"version": "6.6.1-alpha.12+1bad83258",
|
|
4
4
|
"description": "TypeScript plugin for ESLint",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@eslint-community/regexpp": "^4.5.1",
|
|
60
|
-
"@typescript-eslint/scope-manager": "6.6.1-alpha.
|
|
61
|
-
"@typescript-eslint/type-utils": "6.6.1-alpha.
|
|
62
|
-
"@typescript-eslint/utils": "6.6.1-alpha.
|
|
63
|
-
"@typescript-eslint/visitor-keys": "6.6.1-alpha.
|
|
60
|
+
"@typescript-eslint/scope-manager": "6.6.1-alpha.12+1bad83258",
|
|
61
|
+
"@typescript-eslint/type-utils": "6.6.1-alpha.12+1bad83258",
|
|
62
|
+
"@typescript-eslint/utils": "6.6.1-alpha.12+1bad83258",
|
|
63
|
+
"@typescript-eslint/visitor-keys": "6.6.1-alpha.12+1bad83258",
|
|
64
64
|
"debug": "^4.3.4",
|
|
65
65
|
"graphemer": "^1.4.0",
|
|
66
66
|
"ignore": "^5.2.4",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@types/natural-compare": "*",
|
|
75
75
|
"@types/prettier": "*",
|
|
76
76
|
"@typescript-eslint/rule-schema-to-typescript-types": "6.6.0",
|
|
77
|
-
"@typescript-eslint/rule-tester": "6.6.1-alpha.
|
|
77
|
+
"@typescript-eslint/rule-tester": "6.6.1-alpha.12+1bad83258",
|
|
78
78
|
"ajv": "^6.12.6",
|
|
79
79
|
"chalk": "^5.3.0",
|
|
80
80
|
"cross-fetch": "*",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"type": "opencollective",
|
|
104
104
|
"url": "https://opencollective.com/typescript-eslint"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "1bad83258dcb16d188da3c1a5015e903922c2109"
|
|
107
107
|
}
|