fkling / astexplorer

A web tool to explore the ASTs generated by various parsers.
https://astexplorer.net/
MIT License
6.14k stars 729 forks source link

[Updates] typescript v4.7.0 & @typescript-eslint/parser v5.27.0 #649

Closed Ayc0 closed 2 years ago

Ayc0 commented 2 years ago

Since the v4, TS added new syntaxes (specially in this new v4.7.0), so this PR aims to update both TS and @typescript-eslint/parser to be able to support those new syntaxes (and to be up to date with the latest version of TS in general):

See https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/ & https://github.com/typescript-eslint/typescript-eslint/releases/tag/v5.27.0.

typescript

Before After
image out here is improperly considered as an Identifier image but now it's an OutModifier

@typescript-eslint/parser

Before After
image Before it was crashing image But now it can properly parse out as seen by the out: true in the metadata of the generic
Ayc0 commented 2 years ago

As a follow-up, Babel should also be updated to be able to support these new syntaxes (it still crashes with this update):

image

But I feel like updating both TS and babel in 1 PR is a too big change. If needed I can work on the follow-up PR (but it seems to be handled in https://github.com/fkling/astexplorer/pull/647)

fkling commented 2 years ago

Thank you! I need to resolve lock file merge conflicts (due to babel update), but that was easy. Thank you for testing the changes beforehand!