Refactor ESLint configuration and update test rules for clarity and consistency

- Consolidated and modularized `eslint.config.mjs` with defined rules for source, test, E2E, and scripts.
- Improved test and E2E rules with relaxed settings for flexibility and enhanced mocking.
- Standardized variable naming and removed redundant imports in unit and E2E tests.
- Updated error handling and comments to align with modern TypeScript best practices (e.g., `@ts-expect-error`).
This commit is contained in:
2025-11-10 10:57:43 +01:00
parent c8f90e9e8c
commit b2f3ec8f25
26 changed files with 85 additions and 34 deletions

View File

@@ -630,7 +630,7 @@ describe('API Error Handling', () => {
describe('Error message completeness', () => {
it('should have non-empty messages for all error codes', () => {
Object.entries(ERROR_MESSAGES).forEach(([code, message]) => {
Object.entries(ERROR_MESSAGES).forEach(([_code, message]) => {
expect(message).toBeTruthy();
expect(message.length).toBeGreaterThan(0);
expect(message).not.toBe('');
@@ -639,7 +639,7 @@ describe('API Error Handling', () => {
it('should have user-friendly messages', () => {
// Check that messages don't contain technical jargon or error codes
Object.entries(ERROR_MESSAGES).forEach(([code, message]) => {
Object.entries(ERROR_MESSAGES).forEach(([_code, message]) => {
expect(message).not.toContain('null');
expect(message).not.toContain('undefined');
expect(message).not.toContain('Error:');

View File

@@ -4,7 +4,7 @@
* These tests cover hook setup, types, and basic integration
*/
import { renderHook, waitFor } from '@testing-library/react';
import { renderHook } from '@testing-library/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import {
useIsAuthenticated,