deno
deno copied to clipboard
Warn code that uses import assertions
⚠️ This proposal has been demoted from Stage 3 to Stage 2 in January 2023 due to https://github.com/whatwg/html/issues/7233. TC39 is working on a solution, which will require relaxing the "assert only" semantics and potentially changing the syntax. Import assertions have already been shipped in some implementations, consider the current instability when using them.
https://github.com/tc39/proposal-import-assertions
swc issue: https://github.com/swc-project/swc/issues/7179
The import assertions proposal was renamed to import attributes and became stage 3 again in March 2023.
This change, however, came with the assert keyword being changed to with, with assert still accepted as "normative optional, deprecated". So once Deno supports the with keyword, the assert syntax should have a lint or warning indeed.
Hey, quick update on this. Node.js is planning to remove support for assert in v22 (which will be released in April) and Chrome in v126 (which will be released in May).
I saw in the Deno 1.42 blog post that you are working on a new major version, so it might be a good time to also discuss removing assert from Deno.
As we discussed on Discord, we are also removing assert keyword support from Deno in the future.
I am trying to pass the --no-harmony-import-assertions flag to V8 when there is a DENO_FUTURE=1 environment variable. Apparently --harmony-import-assertions is hard-coded in deno_core, so I have to attack it from there.
This is landed in 1.46 and 2.0