MCPcopy Index your code
hub / github.com/CommandCodeAI/BaseAI / formatCode

Function formatCode

packages/baseai/src/utils/ts-format-code.ts:9–20  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

7 * @returns A promise that resolves to the formatted code string.
8 */
9export async function formatCode(code: string) {
10 return await prettier.format(code, {
11 parser: 'typescript',
12 singleQuote: true,
13 trailingComma: 'none',
14 arrowParens: 'avoid',
15 printWidth: 80,
16 useTabs: true,
17 semi: true,
18 tabWidth: 4
19 });
20}

Callers 5

createConfigFileFunction · 0.90
createPipeFunction · 0.90
createLocalToolFunction · 0.90
createLocalPipeFunction · 0.90
createToolFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected