deno icon indicating copy to clipboard operation
deno copied to clipboard

Warn code that uses import assertions

Open petamoriken opened this issue 2 years ago • 4 comments
trafficstars

⚠️ 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

petamoriken avatar Feb 25 '23 11:02 petamoriken

swc issue: https://github.com/swc-project/swc/issues/7179

petamoriken avatar Apr 23 '23 09:04 petamoriken

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.

andreubotella avatar Jul 16 '23 11:07 andreubotella

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.

nicolo-ribaudo avatar Mar 29 '24 09:03 nicolo-ribaudo

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.

petamoriken avatar Apr 21 '24 16:04 petamoriken

This is landed in 1.46 and 2.0

lucacasonato avatar Sep 02 '24 09:09 lucacasonato