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

feat/typesafe - Introduce no-await-without-trycatch #996

Merged
merged 2 commits into from
Jan 14, 2021

Conversation

liangyuanruo
Copy link
Contributor

@liangyuanruo liangyuanruo commented Jan 13, 2021

Problem

Asynchronous calls in code may result in failure, but the code may not handle the failure case. This can lead to a lack of error messages in the UI, or UnhandledPromiseRejection errors and 504 Gateway Timeouts on the server.

Solution

typesafe/no-await-without-trycatch

This new ESLint rule helps to warn developers of the possibility of the failure of an async call, by providing visual feedback for situations where an ES2017 await expression is not used within a try-catch block.

As this rule is meant to be used as a hint without being overly intrusive, the linting rules have been set to warn for non-test code and disabled for test code entirely.

Features:

  • Visual feedback when using await outside of a try-catch block

Screenshots

image

@liangyuanruo liangyuanruo changed the title feat/typesafe - visual warnings for await expressions outside of try-catch blocks feat/typesafe - Introduce no-await-without-trycatch Jan 13, 2021
@mantariksh mantariksh merged commit c55abac into develop Jan 14, 2021
@liangyuanruo liangyuanruo deleted the feat/typesafe branch January 26, 2021 13:52
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.

2 participants