chore: add prettier .vscode config

This commit is contained in:
impart我的impart呢 2024-03-09 11:02:33 +08:00
parent 633e889370
commit 3f6414d624
No known key found for this signature in database
GPG Key ID: 68ED75B1D060D166
2 changed files with 42 additions and 25 deletions

9
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,9 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}

View File

@ -29,10 +29,15 @@ export type Api = {
const buildNotimpl = (name: string) => {
const fn = () =>
l.error(new Error(`没有引擎提供 ${bgMagenta(white(name))}。可能没有加载所需的引擎?`), {
l.error(
new Error(
`没有引擎提供 ${bgMagenta(white(name))}。可能没有加载所需的引擎?`,
),
{
code: 2159,
throw: true,
})
},
)
;(
fn as unknown as {
@ -62,8 +67,11 @@ api.register =
) => {
const newPriority = priority === -1 ? defaultPriority : priority
if (api[method]) {
l.warn(`${cyan(engine)}(${newPriority}) 与 ${cyan(api[method].engine)}(${api[method].priority
}) ${bgMagenta(white(method))} ${newPriority > api[method].priority ? engine : api[method].engine} `)
l.warn(
`${cyan(engine)}(${newPriority}) 与 ${cyan(api[method].engine)}(${
api[method].priority
}) ${bgMagenta(white(method))} ${newPriority > api[method].priority ? engine : api[method].engine} `,
)
if (newPriority < api[method].priority) return
}