MCPcopy Create free account
hub / github.com/NetEase/tango / formatCode

Function formatCode

packages/core/src/helpers/string.ts:135–140  ·  view source on GitHub ↗
(code: string, parser = 'babel')

Source from the content-addressed store, hash-verified

133 * @returns the formatted code
134 */
135export function formatCode(code: string, parser = 'babel') {
136 if (prettier && prettierPlugins) {
137 return prettier.format(code, { parser, plugins: prettierPlugins });
138 }
139 return code;
140}
141
142/**
143 * 是否匹配路由

Callers 3

ast2codeFunction · 0.90
_syncByCodeMethod · 0.90
updateMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected