From b6300a0869250e47ff36f24660bfb96a11fd7e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 12 Feb 2019 11:29:43 +0100 Subject: [PATCH] Add importKind to ImportDeclaration in babel/types --- packages/babel-types/src/definitions/es2015.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/babel-types/src/definitions/es2015.js b/packages/babel-types/src/definitions/es2015.js index f9766935cd..e18d0e4976 100644 --- a/packages/babel-types/src/definitions/es2015.js +++ b/packages/babel-types/src/definitions/es2015.js @@ -322,6 +322,11 @@ defineType("ImportDeclaration", { source: { validate: assertNodeType("StringLiteral"), }, + importKind: { + // Handle Flowtype's extension "import {typeof foo} from" + validate: assertOneOf("type", "typeof", "value"), + optional: true, + }, }, }); @@ -357,7 +362,8 @@ defineType("ImportSpecifier", { }, importKind: { // Handle Flowtype's extension "import {typeof foo} from" - validate: assertOneOf(null, "type", "typeof"), + validate: assertOneOf("type", "typeof"), + optional: true, }, }, });