microsoft / microsoft/TypeScript
rootDir option documentation incorrect and confusing
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the compiler-options handbook page linked in the issue and compare the descriptions of rootDir, rootDirs, and outFile. Clarify that rootDir affects outFile as well as outDir, explain why rootDirs: ["./"] differs from rootDir: "./", and update the documentation so the distinction is understandable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100