Skip to content

Commit 834375b

Browse files
y-hsgwBelco90
andauthored
Update lib/rules/await-async-queries.ts
Co-authored-by: Mario Beltrán <[email protected]> Signed-off-by: Yukihiro Hasegawa <[email protected]>
1 parent d22ff12 commit 834375b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/rules/await-async-queries.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,20 @@ export default createTestingLibraryRule<Options, MessageIds>({
164164
);
165165
}
166166

167-
if (functionExpression.async) {
168-
return IdentifierNodeFixer;
169-
} else {
167+
const ruleFixes = [IdentifierNodeFixer];
168+
if (!functionExpression.async) {
170169
/**
171170
* Mutate the actual node so if other nodes exist in this
172171
* function expression body they don't also try to fix it.
173172
*/
174173
functionExpression.async = true;
175174

176-
return [
177-
IdentifierNodeFixer,
178-
fixer.insertTextBefore(functionExpression, 'async '),
179-
];
175+
ruleFixes.push(
176+
fixer.insertTextBefore(functionExpression, 'async ')
177+
);
180178
}
179+
180+
return ruleFixes;
181181
},
182182
});
183183
}

0 commit comments

Comments
 (0)