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
Upgrade Babel parser to support Typescript 5.0 #788
Conversation
I tried using this upgraded dependency (via a yarn dependency resolution) and it seems to have completely broken TypeScript parsing on my project. I get a bunch of "TypeError: p is not iterable" errors as a result. It seems this was a previously documented issue (#688) and it was fixed in depcheck 1.4.3 by pinning @babel/parser to exactly 7.6.14. There's a related discussion here too (#687). TL;DR unfortunately it seems that upgrading @babel/parser to 7.21.3 re-introduces this problem :( |
Thanks for the comment. I will try to find the fundamental solution. |
Oh I see, that has been merged but not released yet. Thanks for double-checking, and apologies for the false alarm 😄 |
As a workaround, if you're using Yarn, you can both peg the resolved version of the Babel parser (a la #788 (comment)) and then |
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.
Good for me.
Thanks for merging this @rumpl 🙏 |
I'm also waiting for this change to be released 🎉 thank you! |
**User-Facing Changes** None **Description** ts-prune has gone into maintenance mode and is using some old dependencies that block us from using new TS features like `satisfies` (nadeesha/ts-prune#218). Also considered [`unimported`](https://github.com/smeijer/unimported) but it seems nice to have the ability to invoke it a library. https://npmtrends.com/ts-prune-vs-ts-unused-exports-vs-unimported This PR also includes a patch to `depcheck` to get `satisfies` support (the issues have already been fixed on main but it hasn't been released yet): depcheck/depcheck#788
Thank you for fixing this. Looking forward to the release 🙏. |
@rumpl thanks a lot for your efforts. |
This PR upgrades Babel parser to 7.21.3, which supports Typescript 5.0. As it is minor version upgrade, I would expect that there will be no breaking changes.
This will help checking the typescript files with new keywords, such as
satisfies
. Hence, this PR can fix #768To ensure the new syntex support, this PR also adds a simple function to the index.ts file in the test.