From a2824dbd2d6ec8fe5256f77086faeddc20619170 Mon Sep 17 00:00:00 2001 From: Sven Sauleau Date: Wed, 15 Jan 2020 20:36:29 +0000 Subject: [PATCH] docs(ast): add AST for the module attribute proposal Introduce a `ImportModuleAttribute` structure and add an `attributes` key on the `ImportDeclaration` node. --- packages/babel-parser/ast/spec.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/babel-parser/ast/spec.md b/packages/babel-parser/ast/spec.md index d1b1a51ca733..0c30665734c1 100644 --- a/packages/babel-parser/ast/spec.md +++ b/packages/babel-parser/ast/spec.md @@ -107,6 +107,7 @@ These are the core @babel/parser (babylon) AST node types. - [ImportSpecifier](#importspecifier) - [ImportDefaultSpecifier](#importdefaultspecifier) - [ImportNamespaceSpecifier](#importnamespacespecifier) + - [ImportModuleAttribute](#importmoduleattribute) - [Exports](#exports) - [ExportNamedDeclaration](#exportnameddeclaration) - [ExportSpecifier](#exportspecifier) @@ -1221,6 +1222,7 @@ interface ImportDeclaration <: ModuleDeclaration { importKind: null | "type" | "typeof" | "value"; specifiers: [ ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier ]; source: Literal; + attributes?: [ ImportModuleAttribute ]; } ``` @@ -1259,6 +1261,18 @@ interface ImportNamespaceSpecifier <: ModuleSpecifier { A namespace import specifier, e.g., `* as foo` in `import * as foo from "mod.js"`. +### ImportModuleAttribute + +```js +interface ImportModuleAttribute <: Node { + type: "ImportModuleAttribute"; + key: Identifier; + value: StringLiteral; +} +``` + +An attribute specified on the ImportDeclaration. + ## Exports ### ExportNamedDeclaration