-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for taking relative CLI args and using them as absolute internally #32992
Conversation
…or additional args
OK @sheetalkamat - I think I've got your feedback covered, sorry for the delay! |
@@ -2541,7 +2542,16 @@ namespace ts { | |||
for (const id in jsonOptions) { | |||
const opt = optionNameMap.get(id); | |||
if (opt) { | |||
defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is incorrect... You want do want to use convertJsonOption as was earlier here and combine the basePath with the nonrooted Paths as this is an API entry point and you cannot use sys.getCurrentDirectory() here..
The suggestedChange I recommended was to call convertOptionsFromJson
with basePath
as sys.getCurrentDirectory()
Deprecated by #34403 |
Fixes #30457
The idea here is that after
parseCommandLineWorker
has done its work and before it is used for compilation - any relative paths are re-defined as absolute when the CLI options are merged with a tsconfig. Making the example issues in #30457 pass.