microsoft / microsoft/TypeScript

Type check TS file instead of index.d.ts in node_modules leads to build error that cannot be ignored

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

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

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

説明

TypeScript Version: 4.1 RC

Search Terms: node_module check

Code

Run tsc on this PR:

https://github.com/DimensionDev/Maskbook/pull/1879

Emitting this error (I have skipLibCheck on but tsc is going to read .tssource file not.d.ts` file):

node_modules/promievent/PromiEvent.ts:28:33 - error TS2345: Argument of type '(resolve: Resolve<T>, reject: Reject) => void' is not assignable to parameter of type '(resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void'.
  Types of parameters 'resolve' and 'resolve' are incompatible.
    Types of parameters 'value' and 'value' are incompatible.
      Type 'T | PromiseLike<T> | undefined' is not assignable to type 'T | PromiseLike<T>'.
        Type 'undefined' is not assignable to type 'T | PromiseLike<T>'.

28      this.promise = new Promise<T>(executor)
                                      ~~~~~~~~


Found 1 error.

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

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

はじめの一歩

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

調査の方向性

TypeScript 4.1 RC と skipLibCheck を有効にして DimensionDev/Maskbook PR 1879 上で tsc を実行し、報告を再現します。まず node_modules/promievent/PromiEvent.ts の診断から始め、パッケージの index.d.ts ではなく .ts ソースがチェックされる理由を比較します。指定された構成で報告されたビルドエラーが生成されなくなり、既存のコンパイラテストの場所が特定された場合はリグレッションカバレッジが追加されていれば完了です。

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

評価

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

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

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