microsoft / microsoft/TypeScript
Enable `noExplicitAny` in `./tsconfig.json`.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
⭐ Suggestion & 📃 Motivating Example & 💻 Use Cases
The following .js code, in project with a ./tsconfig.json that has allowJs:true, checkJs:true,noImplicitAny:true, does not lint error:
const mySet = new Set;
const myMap = new Map;
const myWeakMap = new WeakMap;
const myArray = [];
const myObj = {};
It would be nice to lint error for those cases when noExplicitAny:true is used.
🔍 Search Terms
noExplicitAny- TypeScript compiler API
./tsconfig.jsonallowJscheckJs
✅ Viability 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, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Verarbeitung von JavaScript-Dateien durch die TypeScript compiler API nachzuverfolgen, wenn allowJs, checkJs und noImplicitAny aktiviert sind, und ermittle anschließend, an welcher Stelle noExplicitAny die gezeigten leeren Set-, Map-, WeakMap-, Array- und Objektfälle melden sollte. Als erledigt gilt die Aufgabe, wenn diese Beispiele bei aktiviertem noExplicitAny Lint-Fehler erzeugen, ohne das ausgegebene JavaScript zu ändern; füge relevante Compiler-Tests hinzu oder aktualisiere sie, falls die bestehende Testabdeckung des Projekts einen geeigneten Ort dafür erkennen lässt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- compilers
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100