microsoft / microsoft/TypeScript

Stripping types should include ts-ignore comments

オープン
#37,144 コメント 5 件 リアクション 1 件 担当者 0 名 GitHub で見る

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

Awaiting More Feedback Suggestion
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

TypeScript Version: 3.8 latest, playground

Search Terms: remove ts-ignore comment

Code

// this is a comment that should be kept
const message: string = 'hello world';
// the below ts-ignore comment should be removed, since it has no meaning in a non-TS context
// @ts-ignore
console.log(message);

Expected behavior:
ts-ignore comment is stripped, other comments are kept.

Actual behavior:
all comments are kept including ts-ignore comments.

Playground Link: https://www.typescriptlang.org/play/#code/PTAEBcAsEsGdTqAhqAxgewLaYKYDtwJIlDZJ0BXAGwBNQAjHUAaxwAdwAoDPWQ3WLCQBzHAC5QfAE7Q8w0AF5QAckg4qVdKADu6KbWUBuTiCJNGm7RFgBaaMLx6mGbPlLlqJsAAFwt+45SONzovOhUOAB0msIAFAJCogCUhkA

Related Issues:

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

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

はじめの一歩

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

調査の方向性

リンク先の TypeScript Playground で例を再現し、出力された JavaScript を期待される動作と比較します。型とコメントの削除を担うコンパイラーパスを追跡し、その後、通常のコメントが残る一方で @ts-ignore が削除されることを確認します。

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

評価

技術スタック
typescript
領域
compilers
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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