From ab3e6bb37cbfd6db99ae5e520991b8be376ae3da Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Sun, 15 Mar 2026 16:35:34 +0800 Subject: [PATCH] chore: fix lint issues --- docs/src/_env/adapter/form.ts | 1 - docs/src/demos/vben-vxe-table/form/index.vue | 2 +- eslint.config.mjs | 2 -- internal/vite-config/src/plugins/extra-app-config.ts | 2 -- internal/vite-config/src/plugins/importmap.ts | 2 -- .../ui-kit/layout-ui/src/components/layout-content.vue | 2 +- .../shadcn-ui/src/components/full-screen/full-screen.vue | 6 +++--- .../ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue | 4 ++-- .../components/captcha/slider-translate-captcha/index.vue | 1 - .../effects/common-ui/src/components/json-viewer/index.vue | 2 +- .../layouts/src/widgets/global-search/global-search.vue | 1 - .../layouts/src/widgets/theme-toggle/theme-button.vue | 2 +- scripts/vsh/src/publint/index.ts | 1 - 13 files changed, 9 insertions(+), 19 deletions(-) diff --git a/docs/src/_env/adapter/form.ts b/docs/src/_env/adapter/form.ts index 30ced04e8..7ebd4acac 100644 --- a/docs/src/_env/adapter/form.ts +++ b/docs/src/_env/adapter/form.ts @@ -10,7 +10,6 @@ import { $t } from '@vben/locales'; import { initComponentAdapter } from './component'; -// oxlint-disable-next-line typescript/no-floating-promises initComponentAdapter(); setupVbenForm({ diff --git a/docs/src/demos/vben-vxe-table/form/index.vue b/docs/src/demos/vben-vxe-table/form/index.vue index bcf3f5a5d..c17679eb3 100644 --- a/docs/src/demos/vben-vxe-table/form/index.vue +++ b/docs/src/demos/vben-vxe-table/form/index.vue @@ -112,7 +112,7 @@ const gridOptions: VxeGridProps = { }, toolbarConfig: { // 是否显示搜索表单控制按钮 - // @ts-ignore 正式环境时有完整的类型声明 + // @ts-ignore - 正式环境时有完整的类型声明 search: true, }, }; diff --git a/eslint.config.mjs b/eslint.config.mjs index b29b567fa..63bd9adc3 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,5 +1,3 @@ -// @ts-check - import { defineConfig } from '@vben/eslint-config'; export default defineConfig(); diff --git a/internal/vite-config/src/plugins/extra-app-config.ts b/internal/vite-config/src/plugins/extra-app-config.ts index d763bbd65..813819bbd 100644 --- a/internal/vite-config/src/plugins/extra-app-config.ts +++ b/internal/vite-config/src/plugins/extra-app-config.ts @@ -49,10 +49,8 @@ async function viteExtraAppConfigPlugin({ console.log(colors.cyan(`✨configuration file is build successfully!`)); } catch (error) { - // oxlint-disable-next-line no-console console.log( colors.red( - // oxlint-disable-next-line typescript/restrict-template-expressions `configuration file configuration file failed to package:\n${error}`, ), ); diff --git a/internal/vite-config/src/plugins/importmap.ts b/internal/vite-config/src/plugins/importmap.ts index 29b65fce6..0ccda99f8 100644 --- a/internal/vite-config/src/plugins/importmap.ts +++ b/internal/vite-config/src/plugins/importmap.ts @@ -68,7 +68,6 @@ async function viteImportMapPlugin( }); if (options?.debug) { - // oxlint-disable-next-line typescript/no-floating-promises (async () => { for await (const { message, type } of generator.logStream()) { console.log(`${type}: ${message}`); @@ -139,7 +138,6 @@ async function viteImportMapPlugin( buildEnd() { // 未生成importmap时,抛出错误,防止被turbo缓存 if (!installed && !isSSR) { - // oxlint-disable-next-line no-unused-expressions installError && console.error(installError); throw new Error('Importmap installation failed.'); } diff --git a/packages/@core/ui-kit/layout-ui/src/components/layout-content.vue b/packages/@core/ui-kit/layout-ui/src/components/layout-content.vue index b5abccb48..26fbfd399 100644 --- a/packages/@core/ui-kit/layout-ui/src/components/layout-content.vue +++ b/packages/@core/ui-kit/layout-ui/src/components/layout-content.vue @@ -26,7 +26,7 @@ interface Props { const props = withDefaults(defineProps(), {}); -// @ts-expect-error unused +// @ts-expect-error - unused const { contentElement, overlayStyle } = useLayoutContentStyle(); const style = computed((): CSSProperties => { diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/full-screen/full-screen.vue b/packages/@core/ui-kit/shadcn-ui/src/components/full-screen/full-screen.vue index 970e713c9..1dcfbbbb2 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/components/full-screen/full-screen.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/components/full-screen/full-screen.vue @@ -12,11 +12,11 @@ const { isFullscreen, toggle } = useFullscreen(); // 重新检查全屏状态 isFullscreen.value = !!( document.fullscreenElement || - // @ts-expect-error: vendor fullscreen APIs are not included in the standard DOM typings + // @ts-expect-error - vendor fullscreen APIs are not included in the standard DOM typings document.webkitFullscreenElement || - // @ts-expect-error: vendor fullscreen APIs are not included in the standard DOM typings + // @ts-expect-error - vendor fullscreen APIs are not included in the standard DOM typings document.mozFullScreenElement || - // @ts-expect-error: vendor fullscreen APIs are not included in the standard DOM typings + // @ts-expect-error - vendor fullscreen APIs are not included in the standard DOM typings document.msFullscreenElement ); diff --git a/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue b/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue index 9c7eb15d0..615d12efd 100644 --- a/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue +++ b/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue @@ -28,9 +28,9 @@ const emit = defineEmits<{ }>(); const active = defineModel('active'); -// @ts-expect-error unused +// @ts-expect-error - unused const contentRef = ref(); -// @ts-expect-error unused +// @ts-expect-error - unused const tabRef = ref(); const style = computed(() => { diff --git a/packages/effects/common-ui/src/components/captcha/slider-translate-captcha/index.vue b/packages/effects/common-ui/src/components/captcha/slider-translate-captcha/index.vue index 02f81ae05..90c2df8b8 100644 --- a/packages/effects/common-ui/src/components/captcha/slider-translate-captcha/index.vue +++ b/packages/effects/common-ui/src/components/captcha/slider-translate-captcha/index.vue @@ -233,7 +233,6 @@ function drawPiece( ctx.fillStyle = 'rgba(255, 255, 255, 0.7)'; ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)'; ctx.stroke(); - // oxlint-disable-next-line no-unused-expressions opr === canvasOpr.clip ? ctx.clip() : ctx.fill(); ctx.globalCompositeOperation = 'destination-over'; } diff --git a/packages/effects/common-ui/src/components/json-viewer/index.vue b/packages/effects/common-ui/src/components/json-viewer/index.vue index a8121de03..415e0c798 100644 --- a/packages/effects/common-ui/src/components/json-viewer/index.vue +++ b/packages/effects/common-ui/src/components/json-viewer/index.vue @@ -11,7 +11,7 @@ import type { } from './types'; import { computed, useAttrs } from 'vue'; -// @ts-expect-error: vue-json-viewer does not expose compatible typings for this import path +// @ts-expect-error - vue-json-viewer does not expose compatible typings for this import path import VueJsonViewer from 'vue-json-viewer'; import { $t } from '@vben/locales'; diff --git a/packages/effects/layouts/src/widgets/global-search/global-search.vue b/packages/effects/layouts/src/widgets/global-search/global-search.vue index 16757e7da..3268fae9d 100644 --- a/packages/effects/layouts/src/widgets/global-search/global-search.vue +++ b/packages/effects/layouts/src/widgets/global-search/global-search.vue @@ -82,7 +82,6 @@ const toggleKeydownListener = () => { }; const toggleOpen = () => { - // oxlint-disable-next-line no-unused-expressions open.value ? modalApi.close() : modalApi.open(); }; diff --git a/packages/effects/layouts/src/widgets/theme-toggle/theme-button.vue b/packages/effects/layouts/src/widgets/theme-toggle/theme-button.vue index ce5809502..8543d36c8 100644 --- a/packages/effects/layouts/src/widgets/theme-toggle/theme-button.vue +++ b/packages/effects/layouts/src/widgets/theme-toggle/theme-button.vue @@ -41,7 +41,7 @@ const bindProps = computed(() => { function toggleTheme(event: MouseEvent) { const isAppearanceTransition = - // @ts-expect-error: startViewTransition is not available in the current DOM lib target + // @ts-expect-error - startViewTransition is not available in the current DOM lib target document.startViewTransition && !window.matchMedia('(prefers-reduced-motion: reduce)').matches; if (!isAppearanceTransition || !event) { diff --git a/scripts/vsh/src/publint/index.ts b/scripts/vsh/src/publint/index.ts index ee8da3b4b..d0786737d 100644 --- a/scripts/vsh/src/publint/index.ts +++ b/scripts/vsh/src/publint/index.ts @@ -168,7 +168,6 @@ function printResult( `${UNICODE.FAILURE} ${totalCount} problem (${errorCount} errors, ${warningCount} warnings, ${suggestionsCount} suggestions)`, ), ); - // oxlint-disable-next-line no-unused-expressions !check && process.exit(1); } else { consola.log(colors.green(`${UNICODE.SUCCESS} No problem`));