microsoft / microsoft/TypeScript
Allow export type for module = none
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
Search Terms
allow export type module none
Suggestion
For "module": "none", please allow export type Foo = { ... }
Use Cases
For ExtendScript code, tsc shouldn't generate export in generated js file.
For ts < 4.0, I can use "module": "ESNext";for ts >= 4.0,I have to use "module": "none"(in ts 4.0.2,"module": "ESNext" will generate export {}, that is error for Extendscript),but I cannot use export type ... in "module": "none", I use export type ... to reuse types between Extendscript and browser js code.
This blocks me to upgrade to typescript 4.0
Examples
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
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, das Problem mit tsc unter Verwendung von "module": "none" und einer export type-Deklaration zu reproduzieren, und vergleiche es anschließend mit "module": "ESNext" sowie dem für TypeScript 4.0 beschriebenen Verhalten. Überprüfe die Modulverarbeitung des Compilers und die Tests für die Ausgabe von Deklarationen, um die erwartete Ausgabe zu bestimmen. Als erledigt gilt die Aufgabe, wenn export type mit module none akzeptiert wird und kein Runtime-Export ausgegeben wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- compilers
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100