Title: Implement a JSDoc @import tag · Issue #22160 · microsoft/TypeScript · GitHub
Open Graph Title: Implement a JSDoc @import tag · Issue #22160 · microsoft/TypeScript
X Title: Implement a JSDoc @import tag · Issue #22160 · microsoft/TypeScript
Description: 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 w...
Open Graph Description: 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 li...
X Description: 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 li...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/22160
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Implement a JSDoc @import tag","articleBody":"# Background\r\n\r\n#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.\r\n\r\n# Options\r\n\r\nBikeshedding time. 🚲 🏠 \r\n\r\n## `@from` `@import`\r\n\r\n```js\r\n/**\r\n * @from \"express\"\r\n * @import { Request, Response as CoolResponse } from\r\n * @import Default\r\n * @import * as ns\r\n */\r\n```\r\n\r\n### Pros\r\n\r\n* Allowing `@from` to precede named import clauses would be easier for completions (this is one of our oldest-duped requests #2371)\r\n* Can have multiple `import` clauses\r\n* Could hypothetically support `@from` before `@import` and vice versa.\r\n\r\n### Cons\r\n\r\n* Doesn't totally look like ESModule syntax which is just extra cognitive overhead.\r\n\r\n## ECMAScript Import-based\r\n\r\n```js\r\n/**\r\n * @import { x, y as z, default as Default } from \"express\"\r\n */\r\n```\r\n\r\n### Pros\r\n\r\n* Nothing to learn if you already know ECMAScript syntax.\r\n\r\n### Cons\r\n\r\n* Less optimal for completions\r\n\r\n# Issues with the Above\r\n\r\nThe 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.)","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2018-02-24T00:01:07Z","url":"https://github.com/microsoft/TypeScript/issues/22160"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4c6a6c03-57a8-6ff3-bfda-b2903678b27c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A16:2E5652:C5A815:FC7B4E:6B00FEF8 |
| html-safe-nonce | 63a322d1dfb3a61652a9cb9bd5f8158b3e33927a2c277cb5f8a7c2fb2eee0b55 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTE2OjJFNTY1MjpDNUE4MTU6RkM3QjRFOjZCMDBGRUY4IiwidmlzaXRvcl9pZCI6IjM1NzA0OTIxMzY5OTY1MzYwNTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3797f0324d94665838eb8cc171760f78be652bfb4d0e75a22602f047bc036bab |
| hovercard-subject-tag | issue:299887401 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/22160/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dec220557fdc23436e1e565ad9846d4cc2cb6af0c72d02764333abed23a71bf1/microsoft/TypeScript/issues/22160 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dec220557fdc23436e1e565ad9846d4cc2cb6af0c72d02764333abed23a71bf1/microsoft/TypeScript/issues/22160 |
| og:image:alt | 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 li... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width