Allow synchronous type-only import of ESM package from CJS #47248
Labels
Committed
The team has roadmapped this issue
feature-request
A request for a new feature
Fix Available
A PR has been opened for this issue
Milestone
Suggestion
🔍 Search Terms
List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.
import, type, esm
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
📃 Motivating Example
For a ESM-only package
esm-package
, if we import types from it in a CommonJS file:TypeScript warns in typescript
4.6.0-dev.20211225
:For type-only import this shouldn't matter since it doesn't emit JavaScript code, so we can allow
💻 Use Cases
Types, in some cases, are not possible to lazy import asynchronously, such as a top level export:
The text was updated successfully, but these errors were encountered: