src/language-js/parser-babel.js/createParse
function createParse(parseMethod, ...pluginCombinations) {
  return (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 && 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@7.10.4 throws `undefined`, when parsing
      // ```js
      // alert(
      // <!-- comment
      // 'hello world'
      // )
      // ```
      // #8688

      const error = _error || { message: "Unknown error" };

      throw createError(
        // babel error prints (l:c) with cols that are zero indexed
        // so we need our custom error
        error.message.replace(/ \(.*\)/, ""),
        error.loc
          ? {
              start: {
                line: error.loc.line,
                column: error.loc.column + 1,
              },
            }
          : { start: { line: 0, column: 0 } }
      );
    }
    delete ast.tokens;
    return postprocess(ast, { ...opts, originalText: text });
  };
}