microsoft / microsoft/TypeScript
Allow export type for module = none
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il problema con tsc usando "module": "none" e una dichiarazione export type, quindi confrontalo con "module": "ESNext" e con il comportamento descritto per TypeScript 4.0. Esamina la gestione dei moduli del compilatore e i test di emissione delle dichiarazioni per determinare l'output previsto. Il lavoro è completato quando export type viene accettato con module none e non viene emesso alcun export a runtime.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100