-
Notifications
You must be signed in to change notification settings - Fork 151
Closed
Labels
Description
Would it be an option to add a fixable rule for the changes made to wait
?
The implementation could look like this
export default function(context) {
return {
"CallExpression > Identifier[name=wait]"(node) {
context.report({
node: node,
message: "waitForRename",
fix: fixer => fixer.replaceText(node, "waitFor")
});
},
"CallExpression[callee.name=waitFor][arguments.length=0]"(node) {
context.report({
node: node,
message: "emptyCallBack",
fix: fixer => fixer.replaceText(node, "waitFor(() => {})")
});
}
};
}
input:
async () => {
await wait(() => {});
await wait();
}
output:
async () => {
await waitFor(() => {});
await waitFor(() => {});
}
tonivj5