Skip to content

fix(eslint-plugin): handle unions in await...for #10110

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 3 commits into from
Oct 13, 2024

Conversation

lotmek
Copy link
Contributor

@lotmek lotmek commented Oct 6, 2024

PR Checklist

Overview

Handle Union types in in the for-statement of the await-thenable rule.
If type is Union, we loop through each types to check if it contains an async Iterator.
If that's the case, we don't report an error.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @lotmek!

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 Oct 6, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit ee78536
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/67040f54eff9d20008ff7fa0
😎 Deploy Preview https://deploy-preview-10110--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: 100 (🟢 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.

Copy link

nx-cloud bot commented Oct 6, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit ee78536. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@lotmek lotmek changed the title fix(eslint-plugin): Handle unions in await...for fix(eslint-plugin): handle unions in await...for Oct 6, 2024
Copy link

codecov bot commented Oct 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.07%. Comparing base (e4e8f4e) to head (ee78536).
Report is 28 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10110   +/-   ##
=======================================
  Coverage   86.07%   86.07%           
=======================================
  Files         428      428           
  Lines       14935    14937    +2     
  Branches     4331     4331           
=======================================
+ Hits        12855    12857    +2     
  Misses       1735     1735           
  Partials      345      345           
Flag Coverage Δ
unittest 86.07% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
packages/eslint-plugin/src/rules/await-thenable.ts 100.00% <100.00%> (ø)

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.

A couple little nits but looks great!

@lotmek lotmek requested a review from kirkwaiblinger October 7, 2024 00:20
@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 Oct 7, 2024
kirkwaiblinger
kirkwaiblinger previously approved these changes Oct 7, 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.

Feel free to tweak the style comments still, but this is great. Thanks!

congratulatory meme

@lotmek lotmek requested a review from kirkwaiblinger October 7, 2024 17:16
@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 Oct 7, 2024
@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 Oct 7, 2024
@JoshuaKGoldberg JoshuaKGoldberg merged commit ef8642b into typescript-eslint:main Oct 13, 2024
65 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: await-thenable doesn't handle unions cleanly in for-await [8.8.0 regression]
4 participants