microsoft / microsoft/TypeScript
[Design Policy] Consider JSDoc feature parity with Typescript
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
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. However it can be annoying when trying to implement something that can't be expressed in JSDoc mode due to requiring Typescript syntax.
As 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.
In 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):
- [Bug?] No way to express the
objecttype- Currently in JSDoc
/** @type {object} */is equivalent to/** @type {any} */, there doesn't seem to be any way to representconst x: objectpurely in JS + JSDoc, this seems like a bug. Fixed
- Currently in JSDoc
interfaceabstract classprotected/privatemembers Fixedfunction overloadingv5.0defaults for genericsdeclaresyntax in it's various forms and declaration mergingdeclare global { ... }declare module "moduleName"declare class Foodeclare interfacedeclare namespace
namespaceenum- /** @enum */ is not quite equivalent
v4.5as const- non-null assertion
expr!
Checklist
My suggestion meets these guidelines:
- [✓] This wouldn't be a breaking change in existing TypeScript/JavaScript code
- [✓] This wouldn't change the runtime behavior of existing JavaScript code
- [✓] This could be implemented without emitting different JS based on the types of the expressions
- [✓] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- [✓] This feature would agree with the rest of TypeScript's Design Goals.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、interface、abstract class、declaration forms、namespace、enum、non-null assertions を含む、一覧にある JSDoc のパリティギャップを確認します。function overloading、generic defaults、as const に関する参照先の issue を追い、その後、どのギャップが残っているかを判断し、提案する各機能の完了基準を定義します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100