changelog_unreleased/javascript/18611.md
import assertions (using the assert keyword) is an old version of the current import attributes proposal.
// Old (deprecated)
import foo from "./foo.json" assert { type: "json" };
// Current standard
import foo from "./foo.json" with { type: "json" };
Babel 8 completely removed support for the legacy assert syntax (the old parser plugin is gone).
Without Babel parser support, Prettier can no longer reliably parse or format code using import ... assert { ... }.
Please migrate to the with syntax.
- import foo from "./foo.json" assert { type: "json" };
+ import foo from "./foo.json" with { type: "json" };
See also Prettier's disclaimer about non-standard syntax.