Avoid flow errors now that we've renamed Babylon to babel-parser.

This commit is contained in:
Logan Smyth
2018-05-21 18:06:17 -07:00
parent 69cca412eb
commit 5fb3696955
2 changed files with 4 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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;