src/language-js/parser-babel.js/rethrowSomeRecoveredErrors
function rethrowSomeRecoveredErrors(ast) {
  const error = ast.errors.find((error) => shouldRethrow(error));
  if (error) {
    throw error;
  }

  return ast;
}