microsoft / microsoft/TypeScript
Module is present in declarations even though it is unused.
オープン
まだ誰も着手していません。
Bug
Domain: Declaration Emit
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
🔎 Search Terms
module unused declarations
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ
⏯ Playground Link
💻 Code
export {}
declare module mod1 {
export type test1 = string;
}
declare module mod2 {
import test1 = mod1.test1;
export { test1 };
}
🙁 Actual behavior
mod1 is kept in the declaration.
🙂 Expected behavior
mod1 is not kept in the declaration file since it is only used in mod2 which is omitted from the declaration file.
Additional information about the issue
Found while working on isolated declarations in test reExportAliasMakesInstantiated.ts added by #54816 (cc @andrewbranch )
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされた TypeScript Playground の例で動作を再現し、次に issue で言及されている isolated-declarations テスト reExportAliasMakesInstantiated.ts を読み、その出力された declaration の出力と比較します。mod2 自体が declaration file から省略されたときに、未使用の mod1 宣言が省略され、関連するテストがその動作をカバーしていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100