Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(eslint-plugin): [promise-function-async] check for promises in implicit return types#6330
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for the PR,@ericbf! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint. |
nx-cloudbot commentedJan 12, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
netlifybot commentedJan 12, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site settings. |
codecovbot commentedJan 12, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@## main #6330 +/- ##==========================================- Coverage 90.61% 90.59% -0.03%========================================== Files 372 372 Lines 12709 12712 +3 Branches 3739 3743 +4 ========================================== Hits 11516 11516- Misses 853 856 +3 Partials 340 340
Flags with carried forward coverage won't be shown.Click here to find out more.
|
3527630
toc65b905
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
overall the changes look good - but we'll need to ensure we're not breaking the API
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
When we return a union containing a promise from a functionimplicitly, it's often a mistake. This commit makes it so if thereturn type is explicit, any `Promise` in the return type (whetherit's part of a union or not) will flag the function. If it isintentional, make the return type explicit.Fixestypescript-eslint#6329
c30bf71
tobe9531d
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
thanks for this!
Uh oh!
There was an error while loading.Please reload this page.
When we return a union containing a promise from a function implicitly, it's often a mistake. This commit makes it so if the return type is explicit, any
Promise
in the return type (whether it's part of a union or not) will flag the function. If it is intentional, make the return type explicit.Fixes#6329
PR Checklist
async
functions returning unions with non-Promise
types #6329Overview
This implements the heuristic that@bradzacher suggested. If the return type is explicit, it allows unions with non-
Promise
types, but if it is implicit, it flags those.