Skip to content
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

Remove TSParenthesizedType #3136

Labels
AST PRs and Issues about the AST structure breaking change This change will require a new major version to be released package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Milestone

Comments

@thorn0
Copy link
Contributor

thorn0 commented Mar 2, 2021

The parser currently generates TSParenthesizedType nodes, which are totally redundant as far as I know.

Or am I missing something and they're actually used somehow?
Did you consider removing them or probably hiding behind a flag?

Related issue in Babel: babel/babel#9546

@thorn0 thorn0 added package: typescript-estree Issues related to @typescript-eslint/typescript-estree triage Waiting for maintainers to take a look labels Mar 2, 2021
@bradzacher bradzacher added AST PRs and Issues about the AST structure breaking change This change will require a new major version to be released and removed triage Waiting for maintainers to take a look labels Mar 2, 2021
@bradzacher
Copy link
Member

This is a legacy AST node that is leftover from the times that the parser didn't do too much smart stuff, and instead just converted any new TS nodes by prefixing their name with TS.

We could probably remove them now, as they only really complicate the AST.
I don't think there's any good arguments for keeping them around.

sonallux added a commit to sonallux/typescript-eslint that referenced this issue May 3, 2021
sonallux added a commit to sonallux/typescript-eslint that referenced this issue May 10, 2021
@bradzacher bradzacher added this to the 5.0.0 milestone Aug 21, 2021
@bradzacher
Copy link
Member

Just because I should have probably done this way back when, figured I'd close this loop now as we're making this change now. @nicolo-ribaudo - if you've got questions about the TS AST - don't hesitate to reach out to me somewhere (slack, github, twitter).

A lot of the weirdness in the TS AST you guys generate is likely due to legacy things from when this project was spun up way back when - so I can probably answer your questions. It'd be good for us to keep in sync as well.

bradzacher added a commit that referenced this issue Aug 22, 2021
fixes #3136

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
bradzacher added a commit that referenced this issue Sep 3, 2021
fixes #3136

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
bradzacher added a commit that referenced this issue Sep 21, 2021
fixes #3136

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2021
bradzacher added a commit that referenced this issue Oct 10, 2021
fixes #3136

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
bradzacher added a commit that referenced this issue Oct 11, 2021
fixes #3136

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AST PRs and Issues about the AST structure breaking change This change will require a new major version to be released package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Projects
None yet
2 participants