-
-
Notifications
You must be signed in to change notification settings - Fork 79
Fix type annotations range #31
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
Codecov Report
@@ Coverage Diff @@
## master #31 +/- ##
==========================================
+ Coverage 85.89% 85.92% +0.02%
==========================================
Files 32 32
Lines 1879 1883 +4
Branches 486 488 +2
==========================================
+ Hits 1614 1618 +4
Misses 180 180
Partials 85 85
Continue to review full report at Codecov.
|
* Top-level type annotation from `typescript-eslint-parser` and `babel-eslint` | ||
*/ | ||
export interface TypeAnnotation extends HasLocation, HasParent { | ||
type: "TSTypeAnnotation" | "TypeAnnotation" |
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.
I know there are many more possible types, but they are rather children of these top level types. And what we need here at this moment is just the top level type annotation on Identifier
. Unless there will be introduced another eslint rule that will respect further cases of typeAnnotation or returnType. What do you think?
Thank you for this PR. However, I'd like to go another way. This is a known issue which is described in README.md.
The root cause is I'd like to add the |
Alright, I wasn't aware of the |
I added So I'm going to close this PR and wait for the feedback there :) It indeed addresses the issue more thoroughly 👍 |
This PR fixes ranges in
typeAnnotation
nodes.Full discussion and description of the problem can be found here: vuejs/vue-cli#1672 (comment)
Essentially, because of not updated range of typeAnnotation - the rule
space-infix-ops
reported wrong nodes causing confusion among typescript users.