master-zapier-plan-draft/vendor/zapier-platform/schema-to-ts/src/formatter.ts
George Lambert b4150c8250 Milestone 0: import zappier billing, Verae middleware, and Zapier research
Compose-ready workspace: packages/zappier (rate card, portal, Stripe),
packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier
(CLI app), vendor/zapier-platform, and research/zapier vendor corpus.

Gate 0 structure checks pass. Product code and research are not yet wired.
2026-09-09 02:37:36 -04:00

20 lines
594 B
TypeScript

import { format as prettify, type Options as PrettierOptions } from 'prettier';
import { logger } from './utils.js';
const DEFAULT_OPTIONS: PrettierOptions = {
bracketSpacing: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 80,
semi: true,
tabWidth: 2,
useTabs: false,
};
/** Format a Typescript module with Prettier. */
export const format = async (ts: string): Promise<string> => {
const options = { parser: 'typescript', ...DEFAULT_OPTIONS };
logger.debug({ options }, 'Finalised prettier options');
const result = prettify(ts, options);
return result;
};