src/language-js/parser-typescript.js/parse
function parse(text, parsers, opts) {
  const jsx = isProbablyJsx(text);
  let result;
  try {
    // Try passing with our best guess first.
    result = tryParseTypeScript(text, jsx);
  } catch (firstError) {
    try {
      // But if we get it wrong, try the opposite.
      result = tryParseTypeScript(text, !jsx);
    } catch (secondError) {
      // Suppose our guess is correct, throw the first error
      const { message, lineNumber, column } = firstError;

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

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

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