使用节点子流程检查更漂亮的需求

问题描述


我的项目中有一个脚本,用于检查有关“更漂亮”的东西的一些要求。
我不确定他们正在检查什么,以及如何修复我的`prettier`,以便它不会引发错误
function spawn(command,arguments) {
  const isWindows = process.platform === "win32";
  const result = childProcess.spawnSync(
    isWindows ? command + ".cmd" : command,arguments,{ stdio: "inherit" }
  );
  if (result.error) {
    console.error(result.error);
    process.exit(1);
  }
  if (result.status !== 0) {
    console.error(`Error while checking: ${command} ${arguments.join(" ")}`);
    process.exit(1);
  }
}

function checkPrettier() {
  console.info("Check Prettier ...");
  spawn("prettier",[
    "--config","./prettier.json","--list-different","src/**/*.{ts,tsx,js,jsx,css}",]);
}

漂亮的检查器函数在控制台Error while checking: prettier --config ./prettier.json --list-different src/**/*.{ts,css}中返回了此值

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)