-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): [no-unnecessary-condition] report when non-nullish is compared to null
/undefined
#1659
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
feat(eslint-plugin): [no-unnecessary-condition] report when non-nullish is compared to null
/undefined
#1659
Conversation
Thanks for the PR, @Retsam! 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. |
4a24c42
to
ccd6777
Compare
Codecov Report
@@ Coverage Diff @@
## v3 #1659 +/- ##
==========================================
- Coverage 93.66% 93.63% -0.03%
==========================================
Files 169 169
Lines 7653 7667 +14
Branches 2187 2190 +3
==========================================
+ Hits 7168 7179 +11
- Misses 228 229 +1
- Partials 257 259 +2
|
=== undefined
null
/undefined
…sh is compared to `null`/`undefined` (#1659)
…sh is compared to `null`/`undefined` (#1659)
…sh is compared to `null`/`undefined` (#1659)
…sh is compared to `null`/`undefined` (#1659)
BREAKING CHANGE:
Fixes #1591 .
This is a pretty minimal "handles exactly the case raised in the issue" fix. While looking into this on the issue tracker, I also found Typescript#32627 which is another case that TS won't catch. Might be worth trying to "beef up" this logic to handle this more generally.