Deprecate import assert in favor of import with#63077
Merged
jakebailey merged 1 commit intomicrosoft:mainfrom Feb 2, 2026
Merged
Deprecate import assert in favor of import with#63077jakebailey merged 1 commit intomicrosoft:mainfrom
jakebailey merged 1 commit intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request deprecates the use of assert keyword in favor of with for import attributes, aligning TypeScript with the updated JavaScript standard. The PR updates all existing tests to use with and adds two new test files to verify the deprecation behavior.
Changes:
- Source code change adds deprecation warning for
assertkeyword - Conversion of 30+ test files from
asserttowithsyntax - Two new test files: one for deprecation errors, one for ignored deprecation
Reviewed changes
Copilot reviewed 139 out of 139 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/compiler/checker.ts | Adds deprecation logic for assert keyword |
| tests/cases/compiler/importAssertionsDeprecated.ts | New test for deprecation error |
| tests/cases/compiler/importAssertionsDeprecatedIgnored.ts | New test with ignoreDeprecations flag |
| tests/cases/fourslash/*.ts | Convert fourslash tests from assert to with |
| tests/cases/conformance/**/*.ts | Convert conformance tests from assert to with |
| tests/baselines/reference/**/. | Updated baselines reflecting error message changes |
andrewbranch
approved these changes
Feb 2, 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.
Fixes #62210
I updated all tests to
with, then introduced two tests just forassert, deprecated and not.