microsoft / microsoft/TypeScript

Specialized error message when too new a lib is provided

Aperta
#60,050 0 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Awaiting More Feedback Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

🔍 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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dalla gestione dell'opzione --lib del compilatore TypeScript e dai test diagnostici esistenti; confronta il percorso generico per i valori non validi con il caso dell'anno ES. Il lavoro è completato quando un anno ES* non supportato riceve una diagnostica dedicata che lo identifica come più recente della versione di TypeScript supportata, con copertura dello scenario tsconfig.json.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
compilers
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.