Skip to content
Prev Previous commit
Next Next commit
feat: refactor loop to map in fixer
  • Loading branch information
neriyarden authored and MichaelDeBoey committed Oct 19, 2024
commit 5fbbc5050e6fa8e323afba3b3dcd837f7243bc20
9 changes: 3 additions & 6 deletions lib/rules/await-async-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,9 @@ export default createTestingLibraryRule<Options, MessageIds>({
messageId: 'awaitAsyncQuery',
data: { name: identifierNode.name },
fix: (fixer) => {
const fixes = [];
for (const ref of references) {
fixes.push(
fixer.insertTextBefore(ref.identifier, 'await ')
);
}
const fixes = references.map((ref) =>
fixer.insertTextBefore(ref.identifier, 'await ')
);
return fixes;
},
});
Expand Down