MCPcopy Create free account
hub / github.com/massCodeIO/massCode / format

Function format

src/main/ipc/handlers/prettier.ts:7–17  ·  view source on GitHub ↗
(source: string, parser: string)

Source from the content-addressed store, hash-verified

5import { store } from '../../store'
6
7export async function format(source: string, parser: string) {
8 const editor = store.preferences.get('editor.code') as EditorSettings
9
10 return prettier.format(source, {
11 parser,
12 tabWidth: Number(editor.tabSize),
13 trailingComma: editor.trailingComma,
14 semi: editor.semi,
15 singleQuote: editor.singleQuote,
16 })
17}
18
19export function registerPrettierHandlers() {
20 ipcMain.handle<PrettierOptions>('prettier:format', (event, payload) => {

Callers 2

todayFunction · 0.85
registerPrettierHandlersFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected