Skip to content

docs: [no-floating-promises] clarify that void does not resolve promises #9949

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

Merged
merged 18 commits into from
Sep 23, 2024
Merged

docs: [no-floating-promises] clarify that void does not resolve promises #9949

merged 18 commits into from
Sep 23, 2024

Conversation

alexandercerutti
Copy link
Contributor

PR Checklist

Overview

Reworded some points of no-floating-promises and added a warn under ignoreVoid option.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @alexandercerutti!

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 on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Sep 6, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 230e741
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66f1045d47dac400083a495a
😎 Deploy Preview https://deploy-preview-9949--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🟢 up 4 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

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

@alexandercerutti alexandercerutti changed the title Improved no-floating-promises documentation docs: Improved no-floating-promises page Sep 6, 2024
@alexandercerutti alexandercerutti changed the title docs: Improved no-floating-promises page docs: [no-floating-promises] improved page Sep 6, 2024
Copy link
Member

@kirkwaiblinger kirkwaiblinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending this in! Sorry for leaving so many comments - the promise docs in general, and especially this rule, deal with quite a bit of subtle nuance.

@kirkwaiblinger kirkwaiblinger added the awaiting response Issues waiting for a reply from the OP or another party label Sep 7, 2024
@Josh-Cena
Copy link
Member

I'll let Kirk take on this since apparently he has a lot of opinions while I have much fewer, but if either of you want to add anything to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#error_handling, and maybe eventually link to it on this doc page, I'd be glad to review a PR over there on MDN.

Copy link

codecov bot commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.70%. Comparing base (1c183ab) to head (230e741).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9949   +/-   ##
=======================================
  Coverage   88.70%   88.70%           
=======================================
  Files         426      426           
  Lines       14835    14835           
  Branches     4312     4312           
=======================================
  Hits        13159    13159           
  Misses       1533     1533           
  Partials      143      143           
Flag Coverage Δ
unittest 88.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label Sep 9, 2024
@alexandercerutti
Copy link
Contributor Author

@Josh-Cena I've added a link to MDN page you linked in order to improve the warning explanation.

@alexandercerutti
Copy link
Contributor Author

alexandercerutti commented Sep 10, 2024

@kirkwaiblinger I've written a paragraph about Promises handling and linked it to the ignoreVoid warning. Let me know what do you think about it.

Once the changes are ready, I'll merge the base branch into this (again).

Copy link
Member

@kirkwaiblinger kirkwaiblinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just need resolution on #9949 (comment)

@alexandercerutti
Copy link
Contributor Author

@kirkwaiblinger done, removed. Should I remove even the warn?

@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label Sep 17, 2024
@kirkwaiblinger
Copy link
Member

@kirkwaiblinger done, removed. Should I remove even the warn?

No, the warn admonition is great! 👌

kirkwaiblinger
kirkwaiblinger previously approved these changes Sep 19, 2024
Copy link
Member

@kirkwaiblinger kirkwaiblinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks for bearing with us on this.
celebratory gif

@kirkwaiblinger kirkwaiblinger added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Sep 19, 2024
@kirkwaiblinger
Copy link
Member

(once another member gets a chance to review, they'll merge it in, and if all goes well this will go out with our next Monday release 🙂)

@github-actions github-actions bot removed the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Sep 19, 2024
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just some small suggestions.

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
@kirkwaiblinger kirkwaiblinger changed the title docs: [no-floating-promises] improved page docs: [no-floating-promises] improved page Sep 19, 2024
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay!

@kirkwaiblinger kirkwaiblinger changed the title docs: [no-floating-promises] improved page docs: [no-floating-promises] clarify that void does not resolve promises Sep 23, 2024
@kirkwaiblinger kirkwaiblinger merged commit c5dc755 into typescript-eslint:main Sep 23, 2024
65 checks passed
@alexandercerutti alexandercerutti deleted the docs/no-floating-promises-rewording branch September 23, 2024 16:33
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: [no-floating-promises] voiding Promise doesn't make it handled
4 participants