microsoft / microsoft/TypeScript

Specialized error message when too new a lib is provided

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

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

Awaiting More Feedback Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

🔍 Search Terms

lib es2024 es2025 esnext

✅ Viability Checklist
⭐ Suggestion

If a lib value is provided that's an ES* version newer than what the current version of TypeScript supports, it'd be nice to have a specialized error message saying so. Today we just get the general "Argument for '--lib' option must be: ..." error with >=59 unique values to read through. It would be nice to explicitly indicate the lib is an ES* that's not yet supported. Maybe...

Error: npm error tsconfig.json(3,13): error TS####: Argument 'ES2027' for '--lib' option is a year not yet supported by TypeScript as of version 5.6.7.
📃 Motivating Example

In practice, if a single package in a monorepo falls out of date, then this error is likely to occur. Having that specialized error can help speed up debugging & make it clear what's going wrong.

Example in the wild: https://github.com/eslint/js/pull/631 -> https://github.com/eslint/js/actions/runs/11017802958/job/30596589705?pr=631 -> https://github.com/eslint/js/pull/632

💻 Use Cases
  1. What do you want to use this for? - Purely for debugging incorrect TS setups.
  2. What shortcomings exist with current approaches? - The error is accurate, but not precise.
  3. What workarounds are you using in the meantime? - Remembering to check the ES year & TypeScript version every time this comes up.

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

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

はじめの一歩

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

調査の方向性

TypeScript コンパイラーの --lib オプションの処理と既存の診断テストから始め、無効な値に対する一般的なパスと ES 年のケースを比較します。サポートされていない ES* 年が、サポートされている TypeScript バージョンより新しいことを示す専用の診断を受け、tsconfig.json シナリオのカバレッジが追加されれば完了です。

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

評価

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

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

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