{"size": 730, "ext": "js", "max_stars_repo_path": "cli/helpers/prettier.js", "max_stars_repo_name": "mkrauskopf/rocker", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "cli/helpers/prettier.js", "max_issues_repo_name": "mkrauskopf/rocker", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "cli/helpers/prettier.js", "max_forks_repo_name": "mkrauskopf/rocker", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.0714285714, "max_line_length": 72, "alphanum_fraction": 0.5438356164}
const prettier = require("prettier/cli");

exports.run = async function (prefix) {
  process.on("unhandledRejection", (reason) => {
    throw reason;
  });

  const fs = require("fs");
  const path = require("path");

  const cwd = prefix ? `${prefix.replaceAll("./", "")}/` : "";

  await prettier.run([
    "--loglevel=warn",
    "--ignore-unknown",
    "--no-config",
    "--no-editorconfig",
    "--bracket-same-line",
    "--quote-props=as-needed",
    "--end-of-line=lf",
    "--print-width=120",
    "--trailing-comma=all",
    "--write",
    fs.existsSync(path.resolve(process.env.INIT_CWD, "src"))
      ? `(${cwd}*\\.(js|ts|jsx|tsx)|(${cwd}src/**/*\\.(js|ts|jsx|tsx)))`
      : `(${cwd}**/*\\.(js|ts|jsx|tsx))`,
  ]);
};