-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(eslint-plugin): [no-unnecessary-type-assertion] handle assignment #3133
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
Conversation
Thanks for the PR, @Zzzen! 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. |
It is weird CI is failing to install dependencies. |
this error is unrelated to your change |
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.
The getContextualType
function was first added in #478 (and was moved to a shared util in #1644).
I'll be honest when I say that I don't remember why I added it - I vaguely remember that there were a number of issues with getContextualType
.
The fact that there's a lint error now that you've removed this logic says that it's still the case that checker.getContextualType
is not infallible.
Please augment the logic instead of removing it.
👌 👌 got it |
Codecov Report
@@ Coverage Diff @@
## master #3133 +/- ##
==========================================
- Coverage 92.88% 92.86% -0.02%
==========================================
Files 315 315
Lines 10706 10715 +9
Branches 3025 3030 +5
==========================================
+ Hits 9944 9951 +7
Misses 342 342
- Partials 420 422 +2
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.
LGTM - thanks for your contribution!
@danielrentz please file a new issue instead of commenting on old PRs. |
should fix #2953
This is an aggressive move, but I don't why we don't use getContextualType directly. All current tests have passed. If this is feasible, I can add more test cases.