refactor: use namespace import to import "typescript"#588
Merged
RebeccaStevens merged 5 commits intoFeb 24, 2026
Conversation
JoshuaKGoldberg
requested changes
Nov 25, 2024
JoshuaKGoldberg
left a comment
Owner
There was a problem hiding this comment.
I'm fine with this, but:
- Would want to hear from @RebeccaStevens as they've been doing a bunch of fantastic work improving the build system (as you've seen)
- If this is 👍, there should be a lint rule to stop new default imports from being added in the future
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v3 #588 +/- ##
=======================================
Coverage 61.16% 61.16%
=======================================
Files 35 35
Lines 2987 2987
Branches 468 468
=======================================
Hits 1827 1827
Misses 1160 1160
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Looks like it's a bad idea, the original package can't be namespace imported |
Contributor
Author
|
Looks like typescript support namespace import now. > Object.keys(await import('typescript')).length
2238 |
865c19b to
ea9702c
Compare
Collaborator
|
Seems good to me. We just need to check that this is valid in all our supported versions of TypeScript |
2 tasks
Owner
3 tasks
RebeccaStevens
added a commit
that referenced
this pull request
Mar 1, 2026
Co-authored-by: Rebecca Stevens <rebecca.stevens@outlook.co.nz> fixes #711
RebeccaStevens
added a commit
that referenced
this pull request
Mar 1, 2026
Co-authored-by: Rebecca Stevens <rebecca.stevens@outlook.co.nz> fixes #711
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
status: accepting prsOverview
In build script of Prettier, we transform the typescript package to ESM for better tree-shake, then we rewrite "import"s
from
ts-api-utils, do you think it's acceptable to use namespace import here? so we don't need rewrite these "import"s.