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(typescript): add 'ts/return-await' rule #509

Merged
merged 1 commit into from
Jun 19, 2024
Merged

feat(typescript): add 'ts/return-await' rule #509

merged 1 commit into from
Jun 19, 2024

Conversation

ryoppippi
Copy link
Contributor

@ryoppippi ryoppippi commented Jun 18, 2024

This commit adds the 'ts/return-await' rule to the TypeScript configuration. This rule enforces that 'return await' is used in async functions.

https://typescript-eslint.io/rules/return-await

Description

Linked Issues

Additional context

This commit adds the 'ts/return-await' rule to the TypeScript
configuration. This rule enforces that 'return await' is used in async
functions.
Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for melodious-froyo-4871f8 ready!

Name Link
🔨 Latest commit 238bcfa
🔍 Latest deploy log https://app.netlify.com/sites/melodious-froyo-4871f8/deploys/667218a03b6b4b00092674e9
😎 Deploy Preview https://deploy-preview-509--melodious-froyo-4871f8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@antfu antfu merged commit 498cb76 into antfu:main Jun 19, 2024
8 checks passed
@ryoppippi ryoppippi deleted the feature/add-return-await branch June 19, 2024 22:35
@Dimava
Copy link
Contributor

Dimava commented Jun 20, 2024

This rule enforces that 'return await' is used in async functions.

Actually it does not

const defaultOptions = 'in-try-catch';
'in-try-catch' - do not allow return await outside of try block

Just to make sure, @ryoppippi does that matches the thing you did intend?

A more opinionated would be always as the page says

Returning an awaited promise improves stack trace information.

@antfu
Copy link
Owner

antfu commented Jun 21, 2024

I would prefer in-try-catch over always

@ryoppippi
Copy link
Contributor Author

i don't mind sheathed you configure this rule. But I wanna configure this. So I registered it as a type-aware rule

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.

3 participants