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): [no-base-to-string] handle intersection types #2170
Conversation
Fixes typescript-eslint#2162 [no-base-to-string] complains about intersection types
Thanks for the PR, @bogdanb! 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 #2170 +/- ##
==========================================
- Coverage 93.47% 93.39% -0.08%
==========================================
Files 171 174 +3
Lines 7813 7889 +76
Branches 2229 2253 +24
==========================================
+ Hits 7303 7368 +65
- Misses 244 247 +3
- Partials 266 274 +8
|
Hi guys! I’m not sure exactly what’s going on with the code coverage test. Either I’m not understanding its report, or I missed something about how the tests work. I expected better coverage from those tests. Any hints? (Also, I’d appreciate some hints on how to lint a local project using the patched code instead of the ones from npm.) |
Codecov comments sometimes do weird things. |
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 your work!
logic itself looks fine.
Just need to get the test coverage higher please.
@bradzacher Hi Brad! Is there a way I could get something like that codecov diff locally? It does not look the way I expected from the tests I added, so I’d like to run a lot of small tests to figure out what’s going on, and I don’t want to spam the pull request with a dozen tiny commits just to get that diff. |
yup! just run the tests and it'll output the coverage to a folder in the plugin root. There'll be some HTML files in there, drag n drop the index file onto chrome and you can view it and click around to see roughly the same output that you see on codecov. |
OK, I got the patch coverage to 100%, mostly by simplifying the logic. I couldn’t figure out a way to generate an intersection type where some of the sub-types have Usefulness.Sometimes. By the way, unless I’m mistaken the rule currently accepts code like this:
I think both of those should be rejected. I could insert an issue & pull request for the first one, at least. (The second one needs more care, to allow things like .) I wanted to finish this one first, and also get a second opinion. By the way, I see a message that the branch is out-of-date with the base branch, which offers me a button to update the branch. Should I trust that it does the right thing? Should I merge the changes by hand? Should I ignore it? |
The "Update branch" button will simply merge master into your branch. It's safe to use it. I would definitely consider raising an issue for |
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!
Fixes #2162 [no-base-to-string] complains about intersection types