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

lint promise-function-async #10802

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

lint promise-function-async #10802

wants to merge 3 commits into from

Conversation

turadg
Copy link
Member

@turadg turadg commented Jan 6, 2025

refs: #10809

Description

Functions that return Promises should do so always. If they are synchronous and throw, the caller will get an exception instead of a rejected promise.

This enables https://typescript-eslint.io/rules/promise-function-async/ to ensure that promise-returning functions are marked async. Its level is "warn" until we are confident to always require this.

Marking this draft because the ergonomics aren't great. We might want to add some features upstream before enabling this.

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Upgrade Considerations

@mhofman
Copy link
Member

mhofman commented Jan 7, 2025

Marking this draft because the ergonomics aren't great. We might want to add some features upstream before enabling this.

Yeah I hate 99% of the changes. We need to configure some exceptions. Let's discuss offline.

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