From 5fb3696955f9e0991cd755d1cb6d6aab1a2a6079 Mon Sep 17 00:00:00 2001 From: Logan Smyth Date: Mon, 21 May 2018 18:06:17 -0700 Subject: [PATCH] Avoid flow errors now that we've renamed Babylon to babel-parser. --- packages/babel-core/src/transformation/normalize-file.js | 3 +++ packages/babel-template/src/parse.js | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/babel-core/src/transformation/normalize-file.js b/packages/babel-core/src/transformation/normalize-file.js index d7911cb0d0..ae2d9a1d8c 100644 --- a/packages/babel-core/src/transformation/normalize-file.js +++ b/packages/babel-core/src/transformation/normalize-file.js @@ -49,6 +49,9 @@ export default function normalizeFile( throw new Error("AST root must be a Program or File node"); } } else { + // The parser's AST types aren't fully compatible with the types generated + // by the logic in babel-types. + // $FlowFixMe ast = parser(pluginPasses, options, code); } diff --git a/packages/babel-template/src/parse.js b/packages/babel-template/src/parse.js index 587668ae5f..9186780f1c 100644 --- a/packages/babel-template/src/parse.js +++ b/packages/babel-template/src/parse.js @@ -142,6 +142,7 @@ function parseWithCodeFrame(code: string, parserOpts: {}): BabelNodeFile { }; try { + // $FlowFixMe - The parser AST is not the same type as the babel-types type. return parse(code, parserOpts); } catch (err) { const loc = err.loc;