Import assertions
import*asblahfrom"./blahb.json"asserts{type: "json" }are non-standard! They were on the standards track, but were replaced with the more capable import attributes
import*asblahfrom"./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.
Import assertions
are non-standard! They were on the standards track, but were replaced with the more capable import attributes
It's subtle, but the difference is the keyword
assertsversuswith.(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.