docs(ComponentCode): update prettier config

This commit is contained in:
Benjamin Canac
2024-07-17 16:39:09 +02:00
parent 59b3873c73
commit df6e2a6378
3 changed files with 9 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
import type { Options } from 'prettier'
import { defu } from 'defu'
import PrettierWorker from '@/workers/prettier.js?worker&inline'
export interface SimplePrettier {
@@ -48,10 +49,10 @@ export default defineNuxtPlugin({
if (import.meta.server) {
const prettierModule = await import('prettier')
prettier = {
format(source, options = {
parser: 'markdown'
}) {
return prettierModule.format(source, options)
format(source, options = {}) {
return prettierModule.format(source, defu(options, {
parser: 'markdown'
}))
}
}
} else {