Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Conversation

Karfroth
Copy link
Contributor

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 #768

To ensure the new syntex support, this PR also adds a simple function to the index.ts file in the test.

@jportner
Copy link

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 :(

@Karfroth
Copy link
Contributor Author

Karfroth commented Apr 13, 2023

Thanks for the comment. I will try to find the fundamental solution.

@Karfroth
Copy link
Contributor Author

@jportner I tried to dig more and I believe this PR will not cause the same issue again. because the fix for the root cause is already merged to the main branch with #745

@jportner
Copy link

@jportner I tried to dig more and I believe this PR will not cause the same issue again. because the fix for the root cause is already merged to the main branch with #745

Oh I see, that has been merged but not released yet.
I was wondering why your unit test passed!

Thanks for double-checking, and apologies for the false alarm 😄

@danieleformichelli
Copy link

@rumpl / @jportner do you think we can merge this and get a new release to fix support for TS5? 🙏

@seansfkelley
Copy link
Contributor

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 yarn patch depcheck to manually patch in the fix to #688, which is thankfully very easy to apply in the transpiled .js.

@znarf znarf changed the title Upgrade Bebel parser to support Typescript 5.0 Upgrade Babel parser to support Typescript 5.0 Jun 8, 2023
Copy link
Collaborator

@znarf znarf left a comment

Choose a reason for hiding this comment

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

Good for me.

@danieleformichelli
Copy link

@znarf @jportner is there any blocker for merging and releasing this? 🙏

@rumpl
Copy link
Member

rumpl commented Jun 27, 2023

@znarf @jportner is there any blocker for merging and releasing this? 🙏

None, I’ll do it this weekend when I get back from my PTO

@rumpl rumpl merged commit 4b23f8b into depcheck:main Jun 27, 2023
@danieleformichelli
Copy link

Thanks for merging this @rumpl 🙏
Do you think we can do a release containing this change? 🙏

@jtbandes
Copy link
Contributor

I'm also waiting for this change to be released 🎉 thank you!

@PeKne
Copy link

PeKne commented Jul 25, 2023

Thank you for fixing this. Looking forward to the release 🙏.

@pkishorez
Copy link

@rumpl thanks a lot for your efforts.
I could see some changes merged to main, yet no release created since last year!
Is there any issue regarding the same?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breaks when using satisfies operator in TypeScript
9 participants