We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 953328f commit 05a9635Copy full SHA for 05a9635
rules/prefer-t-throws.js
@@ -4,6 +4,10 @@ const {visitIf} = require('enhance-visitors');
4
const createAvaRule = require('../create-ava-rule');
5
const util = require('../util');
6
7
+// This function checks if there is an AwaitExpression, which is not inside another function.
8
+// Moreover, if the function encounters a ReturnStatement, it throws an error to avoid reporting special cases as linter error.
9
+//
10
+// TODO: find a simpler way to do this
11
function hasAwaitExpression(nodes) {
12
if (!nodes) {
13
return false;
0 commit comments