-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Implement a JSDoc @import tag #22160
Copy link
Copy link
Closed
Labels
Domain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallySuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Metadata
Metadata
Assignees
Labels
Domain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallySuggestionAn idea for TypeScriptAn idea for TypeScript
Background
#22158 tracks referencing types from a given module using JSDoc-style namepaths. Given that the syntax is somewhat unintuitive and predates the concept of ECMAScript modules, we would like to support a more ergonomic form if we feel it would be helpful.
Options
Bikeshedding time. 🚲 🏠
@from@importPros
@fromto precede named import clauses would be easier for completions (this is one of our oldest-duped requests Request for alternative import syntax to improve auto-complete experience #2371)importclauses@frombefore@importand vice versa.Cons
ECMAScript Import-based
Pros
Cons
Issues with the Above
The options above don't make it explicit that only types are being imported. We could play around with keyword/tag placement (e.g.
@importtype,@import type, etc.)