Skip to content

Deprecate, remove support for import assertions #62210

@DanielRosenwasser

Description

@DanielRosenwasser

Import assertions

import * as blah from "./blahb.json" asserts { type: "json" }

are non-standard! They were on the standards track, but were replaced with the more capable import attributes

import * as blah from "./blahb.json" with { type: "json" }

It's subtle, but the difference is the keyword asserts versus with.

(see more here)

TypeScript 7.0 will only support import attributes, not import assertions. TypeScript 6.0 will deprecate usage of import assertions, meaning an error will be issued on them in the absence of ignoreDeprecations. The workaround is easy: switch to import attributes.

Metadata

Metadata

Assignees

Labels

Breaking ChangeWould introduce errors in existing codeCommittedThe team has roadmapped this issueSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions