Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Allow return-await in try-catch block #282

Merged

Conversation

steven-g-w
Copy link
Contributor

The return await should be allowed in a try-catch block for correct async error handling behavior, for example:

async function doSomething() {
  try {
    return await doSomethingAsync();
  } catch (err) {
    console.log('we have an error!');
  }
}

Using in-try-catch specified in https://typescript-eslint.io/rules/return-await/#in-try-catch
Solve issue #280

@iamturns
Copy link
Owner

Nice one, thanks @steven-g-w 👍

@iamturns
Copy link
Owner

🎉 This PR is included in version 16.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Mar 23, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint-config-airbnb-typescript](https://github.com/iamturns/eslint-config-airbnb-typescript) | devDependencies | patch | [`16.1.2` -> `16.1.4`](https://renovatebot.com/diffs/npm/eslint-config-airbnb-typescript/16.1.2/16.1.4) |

---

### Release Notes

<details>
<summary>iamturns/eslint-config-airbnb-typescript</summary>

### [`v16.1.4`](https://github.com/iamturns/eslint-config-airbnb-typescript/releases/v16.1.4)

[Compare Source](iamturns/eslint-config-airbnb-typescript@v16.1.3...v16.1.4)

##### Bug Fixes

-   disable additional rules handled by TypeScript compiler ([#&#8203;283](iamturns/eslint-config-airbnb-typescript#283)) ([11185a9](iamturns/eslint-config-airbnb-typescript@11185a9))

### [`v16.1.3`](https://github.com/iamturns/eslint-config-airbnb-typescript/releases/v16.1.3)

[Compare Source](iamturns/eslint-config-airbnb-typescript@v16.1.2...v16.1.3)

##### Bug Fixes

-   allow `return await` in `try-catch` block ([#&#8203;282](iamturns/eslint-config-airbnb-typescript#282)) ([221be43](iamturns/eslint-config-airbnb-typescript@221be43)), closes [#&#8203;280](iamturns/eslint-config-airbnb-typescript#280)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Co-authored-by: cabr2-bot <[email protected]>
Co-authored-by: 6543 <[email protected]>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1230
Reviewed-by: 6543 <[email protected]>
Co-authored-by: Calciumdibromid Bot <[email protected]>
Co-committed-by: Calciumdibromid Bot <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants