Skip to content

Commit 05a9635

Browse files
authored
Update prefer-t-throws.js
1 parent 953328f commit 05a9635

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rules/prefer-t-throws.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const {visitIf} = require('enhance-visitors');
44
const createAvaRule = require('../create-ava-rule');
55
const util = require('../util');
66

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
711
function hasAwaitExpression(nodes) {
812
if (!nodes) {
913
return false;

0 commit comments

Comments
 (0)