microsoft / microsoft/TypeScript
Allow '--noEmit' to override 'emitDeclarationOnly' from config.
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
- TS5053
- emitDeclarationOnly
Suggestion
Using "emitDeclarationOnly": true in your tsconfig.json prevents you to do typechecking only runs as running tsc --noEmit will throw the following error.
error TS5053: Option 'emitDeclarationOnly' cannot be specified with option 'noEmit'.
And the CLI does not look like to have any flag to bypass the error (eg. something like --noEmitDeclarationOnly).
I don't see a reason why a noEmit cli flag would not take precedence over the emitDeclarationOnly from the tsconfig.
Use Cases
With a project with a tsconfig.json set with emitDeclarationOnly and using another compiler like babel to produce the built javascript code, you want to be able to both:
- Compile declaration files (running
tsc) - Perform typechecking as a test stage (eg. travis) (running
tsc --noEmit). Especially since you do not use TypeScript to compile (so a build could pass with typings errors).
Examples
https://github.com/mgcrea/node-influx-syslog
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 dalla validazione delle opzioni del compilatore che segnala TS5053 e segui come noEmit della riga di comando viene unito a emitDeclarationOnly di tsconfig. Aggiungi la copertura per la precedenza richiesta e verifica sia i percorsi di emissione delle dichiarazioni sia quelli di controllo dei tipi con noEmit; il lavoro è completato quando tsc --noEmit accetta la configurazione mentre il normale comportamento di tsc rimane invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- cli, compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100