Title: [Design Policy] Consider JSDoc feature parity with Typescript · Issue #30624 · microsoft/TypeScript · GitHub
Open Graph Title: [Design Policy] Consider JSDoc feature parity with Typescript · Issue #30624 · microsoft/TypeScript
X Title: [Design Policy] Consider JSDoc feature parity with Typescript · Issue #30624 · microsoft/TypeScript
Description: Search Terms jsdoc parity, jsdoc equivalence, jsdoc Suggestion The JSDoc mode of TypeScript is very useful in cases where a build step (esp for node libraries for example) isn't desired or when other constraints prevent not writing in JS...
Open Graph Description: Search Terms jsdoc parity, jsdoc equivalence, jsdoc Suggestion The JSDoc mode of TypeScript is very useful in cases where a build step (esp for node libraries for example) isn't desired or when oth...
X Description: Search Terms jsdoc parity, jsdoc equivalence, jsdoc Suggestion The JSDoc mode of TypeScript is very useful in cases where a build step (esp for node libraries for example) isn't desired or when...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/30624
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Design Policy] Consider JSDoc feature parity with Typescript","articleBody":"## Search Terms\r\n\r\njsdoc parity, jsdoc equivalence, jsdoc\r\n\r\n## Suggestion\r\n\r\nThe JSDoc mode of TypeScript is very useful in cases where a build step (esp for node libraries for example) isn't desired or when other constraints prevent not writing in JS. However it can be annoying when trying to implement something that can't be expressed in JSDoc mode due to requiring Typescript syntax.\r\n\r\nAs such I would like to propose that TypeScript ensures that anything that can be written inside a `.ts` file can be expressed (in at least some way) within a pure javascript + jsdoc file.\r\n\r\nIn order to get an idea of the current scope needed for feature parity this is a list of issues and features that break parity between the two modes (if any are missing just say and I'll add to the list):\r\n\r\n- \u003cs>[Bug?] No way to express the `object` type\r\n - Currently in JSDoc `/** @type {object} */` is equivalent to `/** @type {any} */`, there doesn't seem to be any way to represent `const x: object` purely in JS + JSDoc, this seems like a bug.\u003c/s> Fixed\r\n- `interface`\r\n- `abstract class`\r\n- \u003cs>`protected`/`private` members\u003c/s> Fixed\r\n- ~function overloading~ v5.0\r\n - ~[open issue](https://github.com/Microsoft/TypeScript/issues/25590)~\r\n- ~defaults for generics~\r\n - ~[open issue](https://github.com/Microsoft/TypeScript/issues/29401)~\r\n- `declare` syntax in it's various forms and declaration merging\r\n - `declare global { ... }`\r\n - `declare module \"moduleName\"`\r\n - `declare class Foo`\r\n - `declare interface`\r\n - `declare namespace`\r\n- `namespace`\r\n- `enum`\r\n - /** @enum */ is not quite equivalent\r\n- ~`as const`~ v4.5\r\n - ~[open issue](https://github.com/Microsoft/TypeScript/issues/30445)~\r\n- non-null assertion `expr!`\r\n\r\n## Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n\r\n* [✓] This wouldn't be a breaking change in existing TypeScript/JavaScript code\r\n* [✓] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [✓] This could be implemented without emitting different JS based on the types of the expressions\r\n* [✓] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)\r\n* [✓] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n\r\n","author":{"url":"https://github.com/Jamesernator","@type":"Person","name":"Jamesernator"},"datePublished":"2019-03-28T05:07:32Z","url":"https://github.com/microsoft/TypeScript/issues/30624"}
| 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:5328fb12-c718-6223-5453-4b5ac5bf837c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D53C:B53AF:85B475:B3E9C1:6B00E156 |
| html-safe-nonce | 6a5437788b5209e65d3cc1f1d2835895842e26c69fe7a144277a42ab2a40401c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTNDOkI1M0FGOjg1QjQ3NTpCM0U5QzE6NkIwMEUxNTYiLCJ2aXNpdG9yX2lkIjoiMTg2MzQ1NzA1MDE5Mzg3OTM4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2ce4d0dfbb8d57a6234f900e00a4aed840749bf3a3d88fcd92b003b0785f4938 |
| hovercard-subject-tag | issue:426300927 |
| 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/30624/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4876483bde2d9ba0584d0f26b71afb7e74869103fe7c6ca7ccf4256306f635a4/microsoft/TypeScript/issues/30624 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4876483bde2d9ba0584d0f26b71afb7e74869103fe7c6ca7ccf4256306f635a4/microsoft/TypeScript/issues/30624 |
| og:image:alt | Search Terms jsdoc parity, jsdoc equivalence, jsdoc Suggestion The JSDoc mode of TypeScript is very useful in cases where a build step (esp for node libraries for example) isn't desired or when oth... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Jamesernator |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width