Support labels in template string

オープン
#57,385 コメント 4 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript

調査の方向性

動機となる template literal の例から始め、issue で参照されている既存のタプルラベルの IntelliSense の動作と比較してください。template literal のラベルによって IntelliSense のドキュメントが改善され、型や出力される JavaScript の動作が変更されなければ、作業は完了です。

索引モデルが issue の本文から書いたものです。

説明

Awaiting More Feedback Suggestion
🔍 Search Terms

template string label
template string name
interpolation label

✅ Viability Checklist
⭐ Suggestion

The idea is to allow the addition of labels into a template literal.
This has no effect on the type itself in any way, the sole purpose is to give a better DX.

These labels would be shown by IntelliSense in order to provide the same experience as labels for the tuple labels.

📃 Motivating Example
// Template literal today
type Options = {
   name: `${string}/${string}`;
}

// With labels
type Options = {
   name: `${scope: string}/${baseName: string}`;
}
💻 Use Cases

This would offer a slightly better DX.
Right now you can document the parts of the template in a JSDoc comment, but the JSDoc is not preserve by IntelliSense in some cases.

主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/TypeScript のほかの issue

microsoft/TypeScript の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。