export function formatTask()

in packages/web-scripts/src/Tasks/FormatTask/index.ts [40:54]


export function formatTask(task: FormatTaskDesc): SpawnSyncReturns<Buffer> {
  const cmd = 'npx';
  const config = task.config || getPrettierConfig();
  const path = task.path || `${CONSUMING_ROOT}/**/src`;

  const args = [
    '--no-install',
    'prettier',
    ...(config ? ['--config', config] : []),
    '--write',
    `${path}/**/*.{ts,tsx,js,jsx}`,
  ];
  dbg('npx args %o', args);
  return spawn.sync(cmd, args, { stdio: 'inherit' });
}