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

fix(eslint-plugin): [prefer-nullish-coalescing] handle case when type of left side is null or undefined #7225

Merged
merged 1 commit into from Jul 17, 2023

Conversation

auvred
Copy link
Member

@auvred auvred commented Jul 14, 2023

PR Checklist

Overview

The edge case: the type of left side can be explicitly null or undefined. Then there will be no types property and type can't be treated as ts.UnionOrIntersectionType

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @auvred!

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.

@netlify
Copy link

netlify bot commented Jul 14, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 841d45f
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/64b1a8fe3a1bbc0008b895d0
😎 Deploy Preview https://deploy-preview-7225--typescript-eslint.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.

@nx-cloud
Copy link

nx-cloud bot commented Jul 14, 2023

☁️ Nx Cloud Report

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

📂 See all runs for this branch


✅ Successfully ran 31 targets

Sent with 💌 from NxCloud.

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #7225 (841d45f) into main (e08a722) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7225   +/-   ##
=======================================
  Coverage   87.54%   87.55%           
=======================================
  Files         377      377           
  Lines       13172    13173    +1     
  Branches     3892     3893    +1     
=======================================
+ Hits        11532    11533    +1     
  Misses       1261     1261           
  Partials      379      379           
Flag Coverage Δ
unittest 87.55% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...lint-plugin/src/rules/prefer-nullish-coalescing.ts 99.23% <100.00%> (+<0.01%) ⬆️

@bradzacher bradzacher added the bug Something isn't working label Jul 17, 2023
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.

Yup looks great to me - nice little spot fix. Thanks @auvred! 🙌

@JoshuaKGoldberg JoshuaKGoldberg merged commit b62affe into typescript-eslint:main Jul 17, 2023
44 of 46 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [prefer-nullish-coalescing] internal error when linting on binary expression (||) with nullable type
3 participants