Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/lukebennett88/luke-ui. ui.lukebennett.dev
Something went wrong. Try again.
TypeScript
123456789101112131415161718192021222324import type { PlaygroundFormatOptions } from '@luke-ui/playground-core/format';import { formatPlaygroundSource } from '@luke-ui/playground-core/format';
/** The docs playground's Prettier style, matching the repo's own formatting. */const DOCS_PLAYGROUND_FORMAT_OPTIONS = { arrowParens: 'always', bracketSameLine: false, bracketSpacing: true, jsxSingleQuote: false, printWidth: 100, quoteProps: 'as-needed', semi: true, singleAttributePerLine: false, singleQuote: true, tabWidth: 2, trailingComma: 'all', useTabs: true,} as const satisfies PlaygroundFormatOptions;
/** Formats docs playground source. Returns `null` when the source does not parse. */export function formatDocsPlaygroundSource(source: string): Promise<string | null> { return formatPlaygroundSource(source, DOCS_PLAYGROUND_FORMAT_OPTIONS);}