Skip to content

Switch the default of --strict to true - #63087

Merged
Ryan Cavanaugh (RyanCavanaugh) merged 12 commits into
mainfrom
strictByDefault
Feb 4, 2026
Merged

Switch the default of --strict to true#63087
Ryan Cavanaugh (RyanCavanaugh) merged 12 commits into
mainfrom
strictByDefault

Conversation

@DanielRosenwasser

Copy link
Copy Markdown
Member

Fixes#62333

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 true when the option is undefined (instead of false)
  • 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
FileDescription
src/compiler/utilities.tsModified getStrictOptionValue to default to true when strict is undefined
src/compiler/commandLineParser.tsUpdated defaultValueDescription for strict option from false to true
tests/baselines/reference/*.jsAdded "use strict"; directive to generated JavaScript files
tests/baselines/reference/*.errors.txtAdded new type-checking errors caught by stricter defaults (uninitialized properties, implicit any types, etc.)
tests/baselines/reference/*.typesUpdated type inference results to reflect stricter type checking

Comment threadsrc/compiler/utilities.ts
Comment threadsrc/compiler/commandLineParser.ts
@github-project-automationgithub-project-automationBot moved this from Not started to Needs merge in PR BacklogFeb 4, 2026
@jakebaileyJake Bailey (jakebailey) added the Breaking Change Would introduce errors in existing code label Feb 4, 2026

@jakebaileyJake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

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

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamBreaking ChangeWould introduce errors in existing codeFor Milestone BugPRs that fix a bug with a specific milestone

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Enable --strict by default

6 participants

@DanielRosenwasser@jakebailey@RyanCavanaugh@andrewbranch@typescript-bot