-
Notifications
You must be signed in to change notification settings - Fork 13k
Switch libReplacement
to false
by default and fix condition logic
#62391
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
Conversation
Co-authored-by: DanielRosenwasser <[email protected]>
Co-authored-by: DanielRosenwasser <[email protected]>
Co-authored-by: DanielRosenwasser <[email protected]>
libReplacement
to false
by defaultlibReplacement
to false
by default
Is there really no other test affected? We have @copilot investigate. |
I am somewhat certain that I left explicit true/false everywhere back when we decided that it wasn't going to default to false initially. The check is |
Wait, no, the if statement needs to change to |
@copilot do what Jake said. |
I investigated the library resolution tests. The
This provides good test coverage of both disabled (default) and enabled states. The baseline files for the The current test array |
Jake typo'd, he meant if (options.libReplacement !== false) or if (!options.libReplacement) @copilot go |
@copilot I made a typo, reread my comments. |
Changed libReplacement check from `=== false` to truthy check to properly handle the new default behavior. Updated test baselines to reflect the change. Co-authored-by: DanielRosenwasser <[email protected]>
libReplacement
to false
by defaultlibReplacement
to false
by default and fix condition logic
…ead of options.libReplacement Co-authored-by: DanielRosenwasser <[email protected]>
... You're absolutely right! I had the condition backwards. Fixed in commit 6e85eef - changed to
I reread your previous comment and you were correct - Jake's suggested condition was backwards. The fix is now implemented in commit 6e85eef using |
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.
Pull Request Overview
This PR changes the libReplacement
compiler option default from true
to false
and fixes the associated condition logic to properly handle the new default behavior. This makes library replacement an opt-in feature rather than the default.
Key Changes:
- Default value changed from
true
tofalse
in command line parser - Fixed conditional logic to use
!options.libReplacement
instead ofoptions.libReplacement === false
- Updated test baselines to reflect disabled library replacement by default
@typescript-bot test it |
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
@jakebailey Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Everything looks good! |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
Changes the
libReplacement
compiler option default fromtrue
tofalse
and updates the corresponding condition logic to properly handle the new default behavior.Changes Made
defaultValueDescription
fromtrue
tofalse
incommandLineParser.ts
if (options.libReplacement === false)
toif (!options.libReplacement)
to properly handle cases where the option isundefined
(using the new default)Behavior Impact
With the new default:
libReplacement
isundefined
(not specified): Uses default TypeScript libs (no replacement)libReplacement
is explicitlyfalse
: Uses default TypeScript libs (no replacement)libReplacement
is explicitlytrue
: Attempts to resolve replacement libs from@typescript/lib-*
packagesThis change makes lib replacement an opt-in feature rather than the default behavior.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.