-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(eslint-plugin): [strict-boolean-expressions] account for truthy literals #3236
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): [strict-boolean-expressions] account for truthy literals #3236
Conversation
Thanks for the PR, @JoshuaKGoldberg! 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. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
d7020d4
to
2487479
Compare
Well this is an error I haven't seen in a while 😄 :
|
2487479
to
201ac41
Compare
Codecov Report
@@ Coverage Diff @@
## master #3236 +/- ##
==========================================
- Coverage 92.93% 92.82% -0.11%
==========================================
Files 316 318 +2
Lines 10851 10983 +132
Branches 3067 3104 +37
==========================================
+ Hits 10084 10195 +111
- Misses 342 349 +7
- Partials 425 439 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There 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.
nice! almost there - one comment
There 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.
sweet - thanks for this!
Fixes #3115.
I hadn't seen this version of the code with phrases like
is('nullish', 'string')
. Very clever & readable! The code as-is does a lot of loop iterations, but I guess that's fine because type unions are typically very small?