microsoft / microsoft/TypeScript
Duplicated files do not check unused @ts-expect-error properly
オープン
まだ誰も着手していません。
Needs More Info
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Bug Report
🔎 Search Terms
redirectInfo, ts-expect-error
🕗 Version & Regression Information
Tested on 4.3.2, 4.9.5, and next (5.0.0-dev.20230204).
⏯ Playground Link
Reproduction: https://github.com/lamnhh/ts-expect-error-issue
💻 Code
There're 3 packages:
- package-a:
// @ts-expect-error global
export const SOMETHING: number = global.testNumber;
Anything that has an @ts-expect-error directive will work.
- a
package-bthat importspackage-a - anothe
package-cthat imports bothpackage-aandpackage-b.
Install everything, then npm link package-b to use in package-c.
🙁 Actual behavior
Unused '@ts-expect-error' directive.
> typecheck
> tsc --noEmit
../package-b/node_modules/@lamnhh/package-a/index.ts:1:1 - error TS2578: Unused '@ts-expect-error' directive.
1 // @ts-expect-error global
~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in ../package-b/node_modules/@lamnhh/package-a/index.ts:1
🙂 Expected behavior
tsc in package-c passes with no error.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
https://github.com/lamnhh/ts-expect-error-issue の再現用リポジトリから始めます。3つのパッケージをインストールし、package-b を package-c にリンクして、package-a の未使用の @ts-expect-error 診断を再現するために package-c で tsc --noEmit を実行します。package-a のディレクティブが有効なまま、package-c がその診断なしで型チェックを通過すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100