Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Fix: Allow to visit typeParameters in VariableDeclarator #581

Closed
wants to merge 2 commits into from

Conversation

armano2
Copy link
Contributor

@armano2 armano2 commented Dec 16, 2018

This PR adds typeParameters to VariableDeclarator

typeParameters can be only present if kind=type

@armano2 armano2 changed the title visitor keys: Allow to visit typeParameters in VariableDeclarator allow to visit typeParameters in VariableDeclarator Dec 16, 2018
@armano2 armano2 changed the title allow to visit typeParameters in VariableDeclarator Fix: Allow to visit typeParameters in VariableDeclarator Dec 16, 2018
Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small typo, otherwise LGTM. Thanks!

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@armano2
Copy link
Contributor Author

armano2 commented Dec 17, 2018

@platinumazure can i have estimate when this change can be released? its blocking me from fixing some of rules.

@platinumazure
Copy link
Member

@armano2 Very sorry I missed your comment.

Is this PR still needed given the changes in #589 (i.e., is that PR separate/independent from this one)? Thanks!

@armano2
Copy link
Contributor Author

armano2 commented Dec 28, 2018

this PR is needed only for estree v6, but its not needed for v7 because there was change that

type Foo = number

is no longer variable and now its own node TSTypeAliasDeclaration (kind=type got removed)
6aad31d#diff-32f897025e0e51a215a578a256455ab5

@platinumazure
Copy link
Member

platinumazure commented Dec 28, 2018

Thanks, makes sense.

In the PRs for upgrading typescript-estree to 7.x or higher, do we need to go back to visitor-keys.js and remove the override for variable declarations, given the decision to switch the node type for type declarations, if this PR is merged for [email protected]?

@armano2
Copy link
Contributor Author

armano2 commented Dec 28, 2018

yes we will have to do that.

this property is no longer in AST, and it will be better if it's going to be removed when we upgrade to 7.x

@platinumazure
Copy link
Member

@armano2 Understood. Sorry, I wasn't clear: If I merge this PR now, do you need to update #584 and #589 to ensure the property is removed from visitor-keys?

If so, then, given this extra work needed on your side: Should I merge this PR at all (and cut a patch release)? Or should we just close this and have people migrate to a new major version of this plugin (one which supports [email protected] or [email protected])?

I'm leaning towards just closing this, but if you think there's a strong need to fix this for people stuck on earlier versions of TS, I could merge this and do a release, and then request changes on #584 and #589. Let me know what you think the best way forward is here.

@armano2
Copy link
Contributor Author

armano2 commented Dec 28, 2018

@platinumazure yes i will have to update them and i don't mind rebasing / removing it there

@armano2
Copy link
Contributor Author

armano2 commented Dec 31, 2018

any progress on this?

@JamesHenry
Copy link
Member

@armano2 We can close this in favour of #596, right? The node kind in question is no longer available

@JamesHenry JamesHenry closed this Jan 12, 2019
@armano2 armano2 deleted the generic-type branch January 13, 2019 01:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants