microsoft / microsoft/TypeScript
Class member incorrectly stripped from .d.ts output if @internal is mentioned in unrelated comment
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
🔎 Search Terms
internal, .d.ts, stripInternal
🕗 Version & Regression Information
This issue appears to be present in all version of TypeScript (tested down to 3.3.3).
⏯ Playground Link
💻 Code
export class Foo {
/**
* Should be stripped
* @internal
*/
shouldBeStripped = 1;
// TODO: maybe make this @internal?
/**
* Should *not* be stripped
*/
shouldNotBeStripped = 2;
}
🙁 Actual behavior
The compiler should preserve the Foo.shouldNotBeStripped property while removing Foo.shouldBeStripped.
🙂 Expected behavior
Both Foo.shouldNotBeStripped and Foo.shouldBeStripped are removed.
Additional information about the issue
If a class member has an unrelated comment mentioning @internal preceding it, TypeScript will drop that member from the .d.ts output, even though that's not the intent since there's another comment after it. Only the first comment should be checked for @internal.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
stripInternal を有効にしたリンク先の TypeScript Playground と、提供されたクラスを使って動作を再現します。連続するコメントに対する宣言出力の処理を追跡し、独立した @internal の言及が別の @internal コメントの前にあるケースを対象とするリグレッションテストを追加します。完了条件は、shouldBeStripped だけが省略され、shouldNotBeStripped が .d.ts 出力に残ることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100