microsoft / microsoft/TypeScript
Documentation for --declaration and -d incorrect, missing --dry
@RyanCavanaugh ci sta già lavorando.
Dal 25/9/2019.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
When I read the Compiler Options docs (source permalink)[https://github.com/microsoft/TypeScript-Handbook/blame/ee314075d47dbab49a6b631cc45a38d6c555b324/pages/Compiler%20Options.md#L16], I see:
Option Type Default Description --declaration
-dbooleanfalseGenerates corresponding .d.tsfile.
When I try to specify --declaration as a compiler option on the command line, it gives an error. When I try to specify -d as a compiler option on the command line, it seems to activate an undocumented --dry option.
I think tsc needs to be fixed to follow the behavior specified in the documentation or the documentation needs to be updated to describe the --dry compiler option.
Furthermore, by reading the source, I can see that there seem to be config-only compiler options and CLI-only compiler options. The documentation probably needs to be updated to describe how those work/interact and describe when they are different. When a compiler option is config-only, it should never be documented as --optionName because a config-only option will never ever be typed as --optionName.
TypeScript Version: 3.7.0-dev.20190922
Search Terms:
- is:issue is:open declaration dry
Code
$ ./node_modules/.bin/tsc -b --declaration
$ ./node_modules/.bin/tsc -b -d
Expected behavior:
Build with .d.ts files emitted.
Actual behavior:
ohnobinki@gibby /tmp/.private/ohnobinki/typescript-next-play $ ./node_modules/.bin/tsc -b --declaration
error TS5072: Unknown build option '--declaration'.
ohnobinki@gibby /tmp/.private/ohnobinki/typescript-next-play $ ./node_modules/.bin/tsc -b -d
[00:31:11 GMT+0000 (UTC)] A non-dry build would build project '/tmp/.private/ohnobinki/typescript-next-play/tsconfig.json'
Playground Link: n/a
Related Issues:
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.
Valutazione
Questa issue non è ancora stata valutata.