Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Assumes alwaysStrict is effectively always enabled across the compiler/transform pipeline, removing SourceFileAffectingCompilerOptions and updating parsing/binding behavior and test baselines to match.
Changes:
- Remove
SourceFileAffectingCompilerOptionsand associated plumbing from parse/bind/emit paths. - Treat strict mode as always-on for emitted output and for binding non-declaration files.
- Update/trim baselines and skip tests that explicitly set
alwaysStrict=false.
Reviewed changes
Copilot reviewed 300 out of 373 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/transformers/estransforms/usestrict.go | Always inject "use strict" during transform. |
| internal/ast/parseoptions.go | Remove SourceFileAffectingCompilerOptions from parse options and delete helper. |
| internal/binder/binder.go | Bind in strict mode without consulting source-file affecting options. |
| internal/binder/binder_test.go | Update benchmark to reflect removed parse option field. |
| internal/compiler/fileloader.go | Stop computing/passing source-file affecting options; keep external module indicator options. |
| internal/compiler/program.go | Validate that alwaysStrict=false is unsupported and produce a diagnostic. |
| internal/core/compileroptions.go | Remove cached source-file affecting options; keep alwaysStrict only for parsing/validation. |
| internal/project/autoimport.go | Remove passing source-file affecting options while parsing for auto-import registry. |
| internal/project/session_test.go | Adjust tsconfig used in session test. |
| internal/testutil/tsbaseline/js_emit_baseline.go | Remove passing source-file affecting options when parsing in JS emit baselines. |
| internal/testutil/harnessutil/harnessutil.go | Skip tests that explicitly request alwaysStrict=false. |
| testdata/baselines/reference/** | Remove/update reference baselines affected by always-strict behavior and skipped tests. |
DanielRosenwasser
approved these changes
Feb 17, 2026
DanielRosenwasser
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follows from microsoft/TypeScript#63089
alwaysStrictis assumed to be true everywhere.This gets rid of the last
SourceFileAffectingCompilerOptionsfield, so that no longer exists.The only compiler options that matter for the AST are now those used for
ExternalModuleIndicatorOptions.