()
| 26 | ]; |
| 27 | |
| 28 | export function registerPrettierFormatter() { |
| 29 | if (!window?.acode) return; |
| 30 | const alreadyRegistered = acode.formatters.some( |
| 31 | ({ id }) => id === PRETTIER_ID, |
| 32 | ); |
| 33 | if (alreadyRegistered) return; |
| 34 | |
| 35 | acode.registerFormatter( |
| 36 | PRETTIER_ID, |
| 37 | SUPPORTED_EXTENSIONS, |
| 38 | async () => { |
| 39 | const { formatActiveFileWithPrettier } = await import( |
| 40 | /* webpackChunkName: "prettierFormatter" */ "lib/prettierFormatter" |
| 41 | ); |
| 42 | return formatActiveFileWithPrettier(); |
| 43 | }, |
| 44 | PRETTIER_NAME, |
| 45 | ); |
| 46 | } |
no test coverage detected