src/language-js/parser-babel.js/createParse
function createParse(parseMethod, ...pluginCombinations) {
  return (text, parsers, opts = {}) => {
    if (opts.parser === "babel" && isFlowFile(text, opts)) {
      opts.parser = "babel-flow";
      return parseFlow(text, parsers, opts);
    }

    // Inline the require to avoid loading all the JS if we don't use it
    const babel = require("@babel/parser");

    const sourceType =
      opts.__babelSourceType === "script" ? "script" : "module";

    let ast;
    try {
      const combinations = resolvePluginsConflict(
        text.includes("|>"),
        pluginCombinations,
        [
          ["pipelineOperator", { proposal: "smart" }],
          ["pipelineOperator", { proposal: "minimal" }],
          ["pipelineOperator", { proposal: "fsharp" }],
        ]
      );
      ast = tryCombinations(
        (options) => babel[parseMethod](text, options),
        combinations.map((extraPlugins) =>
          babelOptions({ sourceType, extraPlugins })
        )
      );
    } catch (error) {
      // babel error prints (l:c) with cols that are zero indexed
      // so we need our custom error
      const { message, loc } = error;

      throw createError(message.replace(/ \(.*\)/, ""), {
        start: {
          line: loc ? loc.line : 0,
          column: loc ? loc.column + 1 : 0,
        },
      });
    }

    return postprocess(ast, { ...opts, originalText: text });
  };
}