Title: Support JSDoc name paths in JavaScript · Issue #22158 · microsoft/TypeScript · GitHub
Open Graph Title: Support JSDoc name paths in JavaScript · Issue #22158 · microsoft/TypeScript
X Title: Support JSDoc name paths in JavaScript · Issue #22158 · microsoft/TypeScript
Description: Background Part of TypeScript's goal is to provide a rich tooling experience. This includes the scenarios where users are Writing TypeScript which integrates with existing JSDoc'd JavaScript. Using checkJs on a full JS project to leverag...
Open Graph Description: Background Part of TypeScript's goal is to provide a rich tooling experience. This includes the scenarios where users are Writing TypeScript which integrates with existing JSDoc'd JavaScript. Using...
X Description: Background Part of TypeScript's goal is to provide a rich tooling experience. This includes the scenarios where users are Writing TypeScript which integrates with existing JSDoc'd JavaScrip...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/22158
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support JSDoc name paths in JavaScript","articleBody":"# Background\r\n\r\nPart of TypeScript's goal is to provide a rich tooling experience. This includes the scenarios where users are\r\n\r\n1. Writing TypeScript which integrates with existing JSDoc'd JavaScript.\r\n1. Using `checkJs` on a full JS project to leverage the breadth of `.d.ts` files on DefinitelyTyped.\r\n1. Providing a great experience on VS/VS Code/etc. for people who are using JSDoc in loose ways that will hopefully work (or who are willing to put in the effort to get things to work).\r\n\r\nWe'd like to provide users richer tools that can possibly work for existing code as well.\r\n\r\n# Basic Proposal\r\n\r\nThis issue pertains to our JavaScript support via the language service, `allowJs`, and `checkJs`.\r\n\r\nIt tracks understanding some combined set of functionality between [JSDoc's namepaths](http://usejsdoc.org/about-namepaths.html) as well as the way in which import paths function in TypeScript today.\r\n\r\nFor example, the following `@typedef` tags import the `Request` and `Response` interfaces from the module specifiers `\"express\"` and `\"../node_modules/express.Response\"`.\r\n\r\n```js\r\n/**\r\n * @typedef {module:express.Request} Request\r\n * @typedef {module:../node_modules/express.Response} Response\r\n */\r\n```\r\n\r\nSince in TypeScript the import specifier `\"express\"` could originate from...\r\n\r\n* a folder under `node_modules` when using `\"moduleResolution\": \"node\"`\r\n* an ambient module declaration like `declare module \"express\"`\r\n* something which has been path mapped in `compilerOptions.paths`\r\n\r\nwe would do the same resolution here for `express` in `module:express.Request`.\r\n\r\n## Open questions:\r\n\r\n1. What about paths with spaces?\r\n2. How does this work with CommonJS/ESM interop?\r\n\r\n## What this issue doesn't cover?\r\n\r\nWhile name paths are typically introduced via the the `/** @module */` tag (which is not currently supported), this proposal doesn't rely on it. In our brief research, it was unclear whether enough users had a consistent understanding of the tag.\r\n\r\nHowever, one could speculate that the `module` tag would function similarly to an ambient module declaration. This should be covered in a different proposal.","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2018-02-23T23:39:26Z","url":"https://github.com/microsoft/TypeScript/issues/22158"}
| 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:55629861-20cb-9103-c159-7b8476f702eb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E5E2:21E3E7:FAA1EB:14B063D:6B0107E4 |
| html-safe-nonce | 3fd121495d952d348a03f1d7a358d6a40a7db59f92f111976de3a5e6fecae968 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUUyOjIxRTNFNzpGQUExRUI6MTRCMDYzRDo2QjAxMDdFNCIsInZpc2l0b3JfaWQiOiI4OTYzNjE1MTIyNDE3MzIxOTU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b1d86a33909862068466478da2c64e9bff4761e59e09f0121f1aee46c50c5348 |
| hovercard-subject-tag | issue:299884178 |
| 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/22158/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5975a5830152046ece11d2cb8d51c761c9688f646d32ac95fe8e8d4d70aa4427/microsoft/TypeScript/issues/22158 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5975a5830152046ece11d2cb8d51c761c9688f646d32ac95fe8e8d4d70aa4427/microsoft/TypeScript/issues/22158 |
| og:image:alt | Background Part of TypeScript's goal is to provide a rich tooling experience. This includes the scenarios where users are Writing TypeScript which integrates with existing JSDoc'd JavaScript. Using... |
| 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