Add option to always inline .json type import #61614
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Uh oh!
There was an error while loading. Please reload this page.
🔍 Search Terms
json type import inline library resolveJsonModule
✅ Viability Checklist
⭐ Suggestion
Add a tsconfig.json option to force .json type imports to inline the inferred .json type, rather than preserve .json import inside emitted .d.ts
or always inline without introducing a new option
or enable #resolveJsonModule by default
📃 Motivating Example
JSON type imports are a very convenient feature for getting a type of localization strings to get intellisense when dealing with translation strings:
However, as a library author, that presents two issues because TypeScript may preserve the above type import in the .d.ts file:
💻 Use Cases
related issues:
resolveJsonModule
doesn't copy source file when located withinnode_modules
subdirectory #43940The text was updated successfully, but these errors were encountered: