(not) Deprecating `--rootDirs`
Acknowledgement
- [x] I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
Comment
@andrewbranch suggested that rootDirs be deprecated in 6.0 (https://github.com/microsoft/TypeScript/issues/54500#issuecomment-2450555269).
I started talking with @jakebailey about this and we decided that best action would be to discuss via an issue.
At Bloomberg, and I believe Google too. Heavy use of rootDirs is made for the exact reason the docs show as an example, copied here for reference:
src
└── views
└── view1.ts (can import "./template1", "./view2`)
└── view2.ts (can import "./template1", "./view1`)
generated
└── templates
└── views
└── template1.ts (can import "./view1", "./view2")
{
"compilerOptions": {
"rootDirs": ["src/views", "generated/templates/views"]
}
}
https://github.com/microsoft/TypeScript-Website/blob/b0e9a5c007b3e953d409f989f6013078bdd363ed/packages/tsconfig-reference/copy/en/options/rootDirs.md?plain=1#L11-L29
The generated .d.ts files are in a separate 'mirror' directory for source control reasons. But we want them to 'appear' to TypeScript as if they are sibling files so they are picked up by the module resolution.