Skip to content
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

Allow async functions without any 'await' #262

Merged
merged 2 commits into from Dec 12, 2022

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Dec 12, 2022

The lint rules have been updated to allow functions to be async even when they do not use await. It can be useful to make functions async sometimes even when await is not used, because it can simplify error handling for functions that return a Promise without await-ing it (it ensures errors are always rejected, not thrown). It can also be useful in cases when a function that does synchronous work needs to be async to match an interface.

The lint rules have been updated to allow functions to be `async` even
when they do not use `await`. It can be useful to make functions
`async` sometimes even when `await` is not used, because it can
simplify error handling for functions that return a Promise without
`await`-ing it (it ensures errors are always rejected, not thrown). It
can also be useful in cases when a function that does synchronous work
needs to be async to match an interface.
@Gudahtt Gudahtt requested a review from a team as a code owner December 12, 2022 18:16
@Montoya
Copy link

Montoya commented Dec 12, 2022

Yes this is a huge improvement!

Copy link

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!

@Gudahtt Gudahtt merged commit 22b2089 into main Dec 12, 2022
@Gudahtt Gudahtt deleted the allow-async-functions-without-await branch December 12, 2022 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants