fix(ci): 修復 ESLint + spectral-cli 安裝錯誤

- 移除不存在的 @typescript-eslint/no-deprecated 規則
- 修復 npm ENOTEMPTY 錯誤 (先清理舊目錄)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-03-28 19:00:06 +08:00
parent e03d99b871
commit 6ca2efe27b
2 changed files with 4 additions and 3 deletions

View File

@@ -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 ====================

View File

@@ -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)
}, [])