async function getFileInfo(file, options = {}) {
  if (typeof file !== "string" && !(file instanceof URL)) {
    throw new TypeError(
      `expect \`file\` to be a string or URL, got \`${typeof file}\``,
    );
  }

  let { ignorePath, withNodeModules } = options;
  // In API we allow single `ignorePath`
  if (!Array.isArray(ignorePath)) {
    ignorePath = [ignorePath];
  }

  const ignored = await isIgnored(file, { ignorePath, withNodeModules });
  let inferredParser;
  if (!ignored) {
    inferredParser = options.parser ?? (await getParser(file, options));
  }

  return {
    ignored,
    inferredParser: inferredParser ?? null,
  };
}
@param {string | URL} file
@param {FileInfoOptions} options
@returns {Promise<FileInfoResult>}

Please note that prettier.getFileInfo() expects options.plugins to be an array of paths,
not an object.