From 6ca2efe27bed1b3ea7923e707f6cff6d852df381 Mon Sep 17 00:00:00 2001 From: OG T Date: Sat, 28 Mar 2026 19:00:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E4=BF=AE=E5=BE=A9=20ESLint=20+=20sp?= =?UTF-8?q?ectral-cli=20=E5=AE=89=E8=A3=9D=E9=8C=AF=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除不存在的 @typescript-eslint/no-deprecated 規則 - 修復 npm ENOTEMPTY 錯誤 (先清理舊目錄) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yaml | 4 +++- apps/web/src/hooks/useReducedMotion.ts | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9857932a..8ef88d14 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -329,7 +329,9 @@ jobs: - name: Validate run: | - npm install -g @stoplight/spectral-cli + # 修復 ENOTEMPTY npm 錯誤 - 先清理舊目錄 + rm -rf $(npm root -g)/@stoplight/spectral-cli 2>/dev/null || true + npm install -g @stoplight/spectral-cli || npm install -g @stoplight/spectral-cli spectral lint docs/api/api-contract.yaml || true # ==================== Docker Build Verify ==================== diff --git a/apps/web/src/hooks/useReducedMotion.ts b/apps/web/src/hooks/useReducedMotion.ts index 65ce0e5c..81c0a0c1 100644 --- a/apps/web/src/hooks/useReducedMotion.ts +++ b/apps/web/src/hooks/useReducedMotion.ts @@ -84,9 +84,8 @@ export function useReducedMotion(): boolean { } // 舊版瀏覽器 fallback (Safari < 14) - // eslint-disable-next-line @typescript-eslint/no-deprecated + // Note: addListener/removeListener 在新瀏覽器已棄用,但為相容 Safari < 14 保留 mediaQuery.addListener(handleChange) - // eslint-disable-next-line @typescript-eslint/no-deprecated return () => mediaQuery.removeListener(handleChange) }, [])