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 <noreply@anthropic.com>
This commit is contained in:
@@ -32,4 +32,10 @@ export default [
|
|||||||
react: { version: 'detect' },
|
react: { version: 'detect' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
files: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export function parseInputDate(value: string): Date {
|
|||||||
/**
|
/**
|
||||||
* Type guard: check if a value is a valid 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())
|
return date instanceof Date && !isNaN(date.getTime())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user