This document specifies the extensions to the core ESTree AST types to support the ES2025 grammar.
extend interface ImportDeclaration {
attributes: [ ImportAttribute ] | null;
}The attributes is non-empty when import attributes present, e.g., import foo from "./foo.json" with { type: "json" }.
interface ImportAttribute <: Node {
type: "ImportAttribute";
key: Identifier | Literal;
value: Literal;
}An import attribute is an object-like key value pair, e.g. type: "json" in import foo from "./foo.json" with { type: "json" }. The value must be a string literal, that said, value.value is always string-type. If key is a Literal, it must be a string literal.
extend interface ExportNamedDeclaration {
attributes: [ ImportAttribute ] | null;
}attributesmust be an empty array whensourceisnull.
extend interface ExportAllDeclaration {
attributes: [ ImportAttribute ] | null;
}extend interface ImportExpression {
options: Expression | null;
}The options property contains an Expression when import attributes presents, e.g., { with: { type: "json" } } in import(jsonModuleName, { with: { type: "json" } }).