-
-
Notifications
You must be signed in to change notification settings - Fork 11
refactor: use namespace import to import "typescript" #588
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
base: main
Are you sure you want to change the base?
Conversation
JoshuaKGoldberg
left a comment
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.
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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #588 +/- ##
=======================================
Coverage 77.08% 77.08%
=======================================
Files 50 50
Lines 5009 5009
Branches 688 688
=======================================
Hits 3861 3861
Misses 1147 1147
Partials 1 1
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:
|
|
Looks like it's a bad idea, the original package can't be namespace imported |
|
Looks like typescript support namespace import now. > Object.keys(await import('typescript')).length
2238 |
865c19b to
ea9702c
Compare
|
Seems good to me. We just need to check that this is valid in all our supported versions of TypeScript |
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.