Add template variable ${configDir} for substitution of config files directory path#58042
Add template variable ${configDir} for substitution of config files directory path#58042sheetalkamat merged 4 commits intomainfrom
Conversation
...nce/config/convertCompilerOptionsFromJson/Allow trailing comments with jsonSourceFile api.js
Show resolved
Hide resolved
weswigham
left a comment
There was a problem hiding this comment.
Does a --showConfig on a config with paths like these show the input ${configDir} or the resolved disk paths?
There was a problem hiding this comment.
...Do we need to allow escaping $ so you can actually use a $ in a path, rather than as one of these templates? Like if I (somehow - the character is forbidden on NTFS) had an actual directory named ${configDir} - how do you escape from the pattern back to a literal interpretation?
https://github.com/microsoft/TypeScript/pull/58042/files#diff-dfa255ce269b3c80a416b7c133db82a20292076b8c53370637b1aeaff7b8e7f3R110 shows resolved path and i think its useful to show it like that. |
Not sure. i think we should keep this simple as otherwise we need to ensure all the paths are normalized to contain escaped |
| name: "paths", | ||
| type: "object", | ||
| affectsModuleResolution: true, | ||
| allowConfigDirTemplateSubstitution: true, |
There was a problem hiding this comment.
Long term, I do wonder if we'll need some other flag here given we'll introduce more substitutions, but thankfully this is internal!
…mpilerOptions.paths closes #129 NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. Reference: microsoft/TypeScript#58042
…mpilerOptions.paths closes #129 NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. Reference: microsoft/TypeScript#58042
…mpilerOptions.paths (#136) closes #129 NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. Reference: microsoft/TypeScript#58042
|
@sheetalkamat It's a good feature of
{
"root": "./"
}now,
{
"compilerOptions": {
"paths": {
"@root/*": ["${root}/*"]
}
}
} |
${configDir}on any paths is replced with config files directory instead of making it relative to file its declared in.isFilePathoptions,paths,files,includeandexclude7b1a848 is just tests change
9fcd0d6 actual change
Fixes #57485
TODO:
Actual string to use for replacement from design meeting: