Skip to content

(not) Deprecating --rootDirs #61885

Open
Open
@acutmore

Description

@acutmore

Acknowledgement

  • 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 (#54500 (comment)).

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions