Skip to content

Conversation

@RyanCavanaugh
Copy link
Member

@RyanCavanaugh RyanCavanaugh commented Feb 4, 2026

Cleaned up version of #63030. Fixes #62213

Copilot AI review requested due to automatic review settings February 4, 2026 05:27
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Feb 4, 2026
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 4, 2026
@RyanCavanaugh RyanCavanaugh changed the title Always strict true Deprecate alwaysStrict: false Feb 4, 2026
@typescript-bot typescript-bot added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 4, 2026
Copy link
Contributor

Copilot AI left a 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 makes alwaysStrict effectively enabled by default, decouples it from the strict family of options, and updates the compiler and baselines to reflect stricter semantics and deprecation of alwaysStrict=false.

Changes:

  • Introduces a new computed helper getAlwaysStrict and uses it throughout the compiler (binder, transformers, strict-mode checks) instead of treating alwaysStrict as a strict sub-flag.
  • Emits a deprecation diagnostic when alwaysStrict is explicitly set to false, and updates command-line option metadata and strict-mode behavior accordingly.
  • Regenerates a large number of baselines to include "use strict"; in more outputs and to cover new (alwaysstrict=true/false) test variants and deprecation diagnostics.

Reviewed changes

Copilot reviewed 296 out of 2630 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/compiler/utilities.ts Adds getAlwaysStrict computed option, switches strict-mode detection to it, and removes alwaysStrict from StrictOptionName.
src/compiler/transformers/ts.ts Uses getAlwaysStrict to decide when to insert "use strict" and treat files as strict in the TS transformer.
src/compiler/transformers/module/system.ts Uses getAlwaysStrict to determine when to ensure a "use strict" prologue in SystemJS module output.
src/compiler/transformers/module/module.ts Uses getAlwaysStrict for "use strict" handling in other module emit paths.
src/compiler/program.ts Adds a 6.0→7.0 deprecation diagnostic when alwaysStrict is explicitly false.
src/compiler/commandLineParser.ts Updates the alwaysStrict option metadata (no longer a strictFlag, default description now true).
src/compiler/binder.ts Binds files in strict mode based on getAlwaysStrict instead of getStrictOptionValue(..., "alwaysStrict").
tests/baselines/reference/* Updates many baselines to include "use strict";, new strict-mode behaviors, and new alwaysStrict deprecation diagnostics, plus adds (alwaysstrict=true/false) variants.

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a small handful of unit tests which seem to start testing something differently, but it's probably okay

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Feb 4, 2026
@jakebailey
Copy link
Member

@typescript-bot test top800

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 4, 2026

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top800 ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 800 repos with tsc comparing main and refs/pull/63089/merge:

Something interesting changed - please have a look.

Details

47ng/nuqs

12 of 14 projects failed to build with the old tsc and were ignored

packages/scripts/tsconfig.json

  • error TS5107: Option 'alwaysStrict=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

packages/nuqs/tsconfig.build.json

  • error TS5107: Option 'alwaysStrict=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
    • Project Scope

getsentry/sentry-javascript

265 of 271 projects failed to build with the old tsc and were ignored

packages/tanstackstart/tsconfig.json

  • error TS5107: Option 'alwaysStrict=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

packages/react-router/tsconfig.vite.json

  • error TS5107: Option 'alwaysStrict=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

@RyanCavanaugh RyanCavanaugh added this pull request to the merge queue Feb 4, 2026
Merged via the queue into microsoft:main with commit ffd1c3a Feb 4, 2026
33 checks passed
@RyanCavanaugh RyanCavanaugh deleted the alwaysStrictTrue branch February 4, 2026 18:46
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Assume "use strict" everywhere by default

4 participants