chore: eslint 配置
All checks were successful
/ depcheck (push) Successful in 2m19s
/ playwright (push) Successful in 1m45s
/ surge (push) Successful in 2m48s
/ build-and-deploy-to-vercel (push) Successful in 3m10s

This commit is contained in:
mini2024
2025-03-05 00:57:51 +08:00
parent feb7659b75
commit 2b7186ef69
35 changed files with 455 additions and 458 deletions

View File

@ -1,7 +1,7 @@
type AutoInstallModule = { [K: string]: unknown; install?: UserPlugin };
type UserPlugin = (ctx: UserPluginContext) => void;
// https://github.com/antfu-collective/vitesse/blob/47618e72dfba76c77b9b85b94784d739e35c492b/src/modules/README.md
type UserPluginContext = { app: import('vue').App<Element> };
type UserPlugin = (ctx: UserPluginContext) => void;
type AutoInstallModule = { install?: UserPlugin; [K: string]: unknown };
export function setupPlugins(app: import('vue').App, modules: AutoInstallModule | Record<string, unknown>) {
console.group('🔌 Plugins');

View File

@ -12,17 +12,17 @@ export function install({ app }: { app: import('vue').App<Element> }) {
app.use(PrimeVue, {
locale: {
...zhCN['zh-CN'],
completed: '已上传',
noFileChosenMessage: '未选择文件',
pending: '待上传',
completed: '已上传',
}, // usePrimeVue().config.locale
theme: {
preset: Aura,
options: {
prefix: 'p',
darkModeSelector: '.app-dark' /* 'system' */,
cssLayer: false,
darkModeSelector: '.app-dark' /* 'system' */,
prefix: 'p',
},
preset: Aura,
},
});
}

View File

@ -8,7 +8,6 @@ const setupLayoutsResult = setupLayouts(routes);
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: /* routes ?? */ setupLayoutsResult,
strict: true,
scrollBehavior: (_to, _from, savedPosition) => {
if (savedPosition) {
return savedPosition;
@ -16,6 +15,7 @@ const router = createRouter({
return { left: 0, top: 0 };
}
},
strict: true,
});
if (import.meta.hot) handleHotUpdate(router);
if ($__DEV__) Object.assign(window, { router });
@ -23,7 +23,7 @@ router.onError((error) => {
console.debug('🚨 [router error]: ', error);
});
export { router, setupLayoutsResult, createGetRoutes };
export { createGetRoutes, router, setupLayoutsResult };
export function install({ app }: { app: import('vue').App<Element> }) {
app
// Register the plugin before the router