src/language-js/parser-espree.js/parse
function parse(originalText, parsers, options) {
  const { parse, latestEcmaVersion } = require("espree");
  espreeOptions.ecmaVersion = latestEcmaVersion;

  // Replace shebang with space
  const shebang = getShebang(originalText);
  const text = shebang
    ? " ".repeat(shebang.length) + originalText.slice(shebang.length)
    : originalText;

  let ast;

  try {
    ast = parse(text, espreeOptions);
  } catch (moduleError) {
    try {
      ast = parse(text, { ...espreeOptions, sourceType: "script" });
    } catch (_) {
      // throw the error for `module` parsing
      const { message, lineNumber, column } = moduleError;

      /* istanbul ignore next */
      if (typeof lineNumber !== "number") {
        throw moduleError;
      }

      throw createError(message, { start: { line: lineNumber, column } });
    }
  }

  return postprocess(ast, { ...options, originalText });
}