microsoft / microsoft/TypeScript
rootDir option documentation incorrect and confusing
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
I've recently started a new project with TS and run into some confusing behaviour. I've placed my files in an "app" folder, but the emitted TS (using AMD modules with --outFile) generates module names without the app prefix, breaking my JS references.
Turns out that I was supposed to use rootDir, instead of rootDirs.
The first issue is that since #5819, this actually does affect outFile as well, so the documentation clearly stating it only applies to outDir is wrong.
The second issue is that it's really confusing the difference between rootDirs and rootDir, and it's still unclear to me why rootDirs: ["./"] did not produce the same result as rootDir: "./". The written documentation is not very clear out this and potentially, one or both options neeed renaming.
This is referencing the current live version on https://www.typescriptlang.org/docs/handbook/compiler-options.html
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
Iniziate dalla pagina del manuale delle opzioni del compilatore collegata nell’issue e confrontate le descrizioni di rootDir, rootDirs e outFile. Chiarite che rootDir influisce su outFile oltre che su outDir, spiegate perché rootDirs: ["./"] differisce da rootDir: "./" e aggiornate la documentazione in modo che la distinzione sia comprensibile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers, documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100