(source: string, parser: string)
| 5 | import { store } from '../../store' |
| 6 | |
| 7 | export 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 | |
| 19 | export function registerPrettierHandlers() { |
| 20 | ipcMain.handle<PrettierOptions>('prettier:format', (event, payload) => { |
no test coverage detected