Avoid flow errors now that we've renamed Babylon to babel-parser.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user