-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Switch the default of --strict to true
#63087
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
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 default value of the --strict compiler option from false to true. This is a significant breaking change that enables all strict type-checking options by default.
Changes:
- Modified the strict option default handling to return
truewhen the option is undefined (instead offalse) - Updated the command-line parser metadata to reflect the new default value of
true - Regenerated test baselines to reflect the new stricter type checking behavior
Reviewed changes
Copilot reviewed 284 out of 13088 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/compiler/utilities.ts | Modified getStrictOptionValue to default to true when strict is undefined |
| src/compiler/commandLineParser.ts | Updated defaultValueDescription for strict option from false to true |
| tests/baselines/reference/*.js | Added "use strict"; directive to generated JavaScript files |
| tests/baselines/reference/*.errors.txt | Added new type-checking errors caught by stricter defaults (uninitialized properties, implicit any types, etc.) |
| tests/baselines/reference/*.types | Updated type inference results to reflect stricter type checking |
jakebailey
left a comment
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.
Pretty shocked there are no changes to any unit tests or related baselines; I verified locally too
Fixes #62333