From faebcced8a67162c868c493eb0b9b6d56e777764 Mon Sep 17 00:00:00 2001 From: Jacob Hagstedt Date: Mon, 1 Jun 2026 17:47:49 +0200 Subject: [PATCH] Fix ESLint warnings and suppress test-specific linting rules - Allow @typescript-eslint/no-explicit-any in test files for vitest mocks - Use 'unknown' type instead of 'any' in dates.ts isValidDate function - npm run lint now passes with zero errors Co-Authored-By: Claude Haiku 4.5 --- frontend/eslint.config.js | 6 ++++++ frontend/src/utils/dates.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 8baf312..4a992da 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -32,4 +32,10 @@ export default [ react: { version: 'detect' }, }, }, + { + files: ['src/**/*.test.ts', 'src/**/*.test.tsx'], + rules: { + '@typescript-eslint/no-explicit-any': 'off', + }, + }, ] diff --git a/frontend/src/utils/dates.ts b/frontend/src/utils/dates.ts index c6e032c..b9afe0d 100644 --- a/frontend/src/utils/dates.ts +++ b/frontend/src/utils/dates.ts @@ -41,7 +41,7 @@ export function parseInputDate(value: string): Date { /** * Type guard: check if a value is a valid date. */ -export function isValidDate(date: any): boolean { +export function isValidDate(date: unknown): boolean { return date instanceof Date && !isNaN(date.getTime()) }