microsoft / microsoft/TypeScript
Shorten method signatures (aka "type madness")
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
Some of the types that make everything work behind the scenes are ridiculous. For example, from Vue.js:

For a Vue developer creating a new Vue instance in JavaScript, they will be exposed to this every time. If they already know what arguments to supply, this does not do a great job as a quick reminder. If they don't know what args to supply, this is probably not very helpful either. We should be able to give users an option to show a concise method signature like the following.

In this example, the tildas indicate that there is "type madness" hidden below. If the user really wants to see the types, they can goToDefinition or maybe we could give them a way to expand the signature window.
We would need to pick some arbitrary line when to display type information and when to hide it. My initial thinking is something along the lines of:
- Hide all generic types, but leave angle brackets in
- Hide types when there are more than 2 unions or intersections
- Show string literals if less than 100 characters (roughly 2 lines?)
I would imagine we would also want to give JavaScript users the concise signature by default and TypeScript users the full signature by default, but give both the camps the ability to configure to their preference.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
このissueでは、ファイル、テスト、エントリーポイントが指定されていません。まず、ジェネリック型、ユニオン、インターセクション、長い文字列リテラルを非表示にするために提案されているルールと、要求されているJavaScriptおよびTypeScriptのデフォルト設定を確認します。ユーザーが簡潔なシグネチャまたは完全なシグネチャを設定し、意図した形式を確認できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- developer-experience, tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100