-
-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule proposal: no-unnecessary-async #2487
Comments
I think it's a good idea in general, but without types, it's really infeasible, and we don't have types available here. It may more appropriate for https://github.com/typescript-eslint/typescript-eslint |
@sindresorhus isn't it possible for the rule to check if there is an |
That would miss functions that return a promise: async function getLast(arr: number[]) {
return thisReturnsAPromise();
} |
Pretty sure this exists and it's disabled in XO. |
@fregante you are right! Those rules do that, thanks for the hint! |
Description
The rule would be beneficial in avoiding async functions that are, in reality, synchronous, and no
async
is necessary.Unnecessary async function breaks unit tests that use fake timers.
Fail
Pass
Proposed rule name
no-unnecessary-async
Additional Info
No response
The text was updated successfully, but these errors were encountered: