Skip to content

Allow async functions without any 'await'#262

Merged
Gudahtt merged 2 commits intomainfrom
allow-async-functions-without-await
Dec 12, 2022
Merged

Allow async functions without any 'await'#262
Gudahtt merged 2 commits intomainfrom
allow-async-functions-without-await

Conversation

@Gudahtt
Copy link
Copy Markdown
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
Copy Markdown

Montoya commented Dec 12, 2022

Yes this is a huge improvement!

Copy link
Copy Markdown

@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.

4 participants