microsoft / microsoft/TypeScript

Auto fix compilerOptions Lib

Aperta
#32,560 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Experience Enhancement Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

Search Terms

compilerOptions Lib, autofix Lib, auto Lib generation, Auto compilerOptions

Suggestion

Suggest adding the appropriate library to compilerOptions.lib if you are using a feature that requires it.

Use Cases

  • Help the developer code by preventing them from having to look up which compilerOptions.lib setting they need to use a particual feature of the standard library. As it is difficult to remember which version of ES introduced which additions.
  • In the future this could be used to auto generate the compilerOptions.Lib the developer needs by the JS features they are using. Which would remove some configuration. 🎉

Examples

Object.entities(object).map(([key, value]) => {
  ...
});

📎💬 “Looks like your using Object.entities, would you like to add 'es2017.object' to your compilerOptions.lib?”


if (array.includes(testValue)) {
  ...
}

📎💬 “Looks like your using Array.include, would you like to add 'es2016.array.include' to your compilerOptions.lib?”

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

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 esaminando la proposta dell’issue relativa a compilerOptions.lib e gli esempi di Object.entries e Array.includes. Definisci come l’uso delle funzionalità verrebbe associato a nomi di librerie come es2017.object e es2016.array.include, e considera il caso d’uso più ampio della generazione automatica; il lavoro sarà completato quando il design e l’ambito saranno definiti.

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

Valutazione

Stack tecnologico
typescript
Ambito
compilers
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.