microsoft / microsoft/TypeScript
Trailing comma in dynamic import should be allowed also when used in a `typeof` type
オープン
まだ誰も着手していません。
Domain: ES Modules
Help Wanted
Possible Improvement
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
🔎 Search Terms
trailing comma dynamic import
🕗 Version & Regression Information
- This is the behavior in every version I tried
⏯ Playground Link
💻 Code
declare module "foo" {}
const v = await import("foo",);
type T = typeof import("foo",);
const v2 = await import("foo",{},);
type T2 = typeof import("foo",{},);
🙁 Actual behavior
The trailing commas in the type-level import()s are reported as syntax error
🙂 Expected behavior
The syntax of import() at the type-level should match the one at the value level, thus allowing trailing commas.
Additional information about the issue
Note that the error was correct before import attributes, but import attributes changed the dynamic import syntax to allow trailing commas.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされている TypeScript Playground から始めて、値レベルと型レベルの動的 import における末尾カンマのケースを再現します。2 つの形式がどのようにパースされるかを比較し、その後、両方の例に対するリグレッションカバレッジを追加します。typeof import() が値レベルの import() と同じ末尾カンマ構文を受け入れれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100