Skip to content

Deprecate import assert in favor of import with - #63077

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:deprecate-assert
Feb 2, 2026
Merged

Deprecate import assert in favor of import with#63077
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:deprecate-assert

Conversation

@jakebailey

Copy link
Copy Markdown
Member

Fixes#62210

I updated all tests to with, then introduced two tests just for assert, deprecated and not.

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 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 assert keyword
  • Conversion of 30+ test files from assert to with syntax
  • 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
FileDescription
src/compiler/checker.tsAdds deprecation logic for assert keyword
tests/cases/compiler/importAssertionsDeprecated.tsNew test for deprecation error
tests/cases/compiler/importAssertionsDeprecatedIgnored.tsNew test with ignoreDeprecations flag
tests/cases/fourslash/*.tsConvert fourslash tests from assert to with
tests/cases/conformance/**/*.tsConvert conformance tests from assert to with
tests/baselines/reference/**/.Updated baselines reflecting error message changes

Comment threadsrc/compiler/checker.ts
@jakebaileyJake Bailey (jakebailey) added the Breaking Change Would introduce errors in existing code label Jan 31, 2026
@github-project-automationgithub-project-automationBot moved this from Not started to Needs merge in PR BacklogFeb 2, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queueFeb 2, 2026
Merged via the queue into microsoft:main with commit 1fd0c53Feb 2, 2026
38 of 39 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the deprecate-assert branch February 2, 2026 16:42
@github-project-automationgithub-project-automationBot moved this from Needs merge to Done in PR BacklogFeb 2, 2026
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Aug 3, 2026
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.

Deprecate, remove support for import assertions

5 participants

@jakebailey@andrewbranch@weswigham@typescript-bot