microsoft / microsoft/TypeScript

Auto fix compilerOptions Lib

Offen
#32,560 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Experience Enhancement Suggestion
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit der Prüfung des Vorschlags der Issue zu compilerOptions.lib sowie der Beispiele für Object.entries und Array.includes. Legen Sie fest, wie die Verwendung von Features auf Bibliotheksnamen wie es2017.object und es2016.array.include abgebildet wird, und berücksichtigen Sie den umfassenderen Anwendungsfall der automatischen Generierung; abgeschlossen ist die Aufgabe, wenn Design und Umfang geklärt sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
compilers
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.