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): false-positive/negative with array index in no-unnecessary-condition #3805
fix(eslint-plugin): false-positive/negative with array index in no-unnecessary-condition #3805
Conversation
Thanks for the PR, @ypresto! 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! |
Codecov Report
@@ Coverage Diff @@
## master #3805 +/- ##
==========================================
+ Coverage 92.68% 93.57% +0.89%
==========================================
Files 327 147 -180
Lines 11351 7865 -3486
Branches 3201 2492 -709
==========================================
- Hits 10521 7360 -3161
+ Misses 369 161 -208
+ Partials 461 344 -117
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.
thanks for this!
This PR fixes several false-positive/negatives in no-unnecessary-condition.
arr[42]?.foo ?? 0
arr[42] ?? 0
wherearr[42]
is always nullish or never.arr[0].foo?.bar
wherefoo
is not nullable.