Add template variable ${configDir} (name to be determined) for file path substitution ยท Issue #57485 ยท microsoft/TypeScript (original) (raw)

๐Ÿ” Search Terms

"extends", "compilerOptions", "paths", "outdir", "include", "exclude", "typeRoots", "tsconfig", "ability to make tsconfig paths relative to final config"

โœ… Viability Checklist

โญ Suggestion

Subset of #56436

Today when all the options that are file paths, are always relative to config they are specified in. But that also means that if you are extending tsconfig and you want eg say outDir to be same name but relative to your config, you have to re-specify it in the config. The proposal is to use template variable in base config which would mean that the resulting file paths are relative to final config directory. Name is to be determined.

Consider:

Today the resulting config of project1 is:

Proposal is to write base.tsconfig.json as:

and this should result in computed tsconfig.json as:

Names that came up in design meeting:

๐Ÿ“ƒ Motivating Example

A way to specify root config that can specify include and/or outDir and not needing to write than in each project.
Issues: #29172, #30163, #37227, #45050, #51213

๐Ÿ’ป Use Cases

  1. What do you want to use this for?
  2. What shortcomings exist with current approaches?
  3. What workarounds are you using in the meantime?