import nextCoreWebVitals from 'eslint-config-next/core-web-vitals'; import nextTypescript from 'eslint-config-next/typescript'; import jsxA11y from 'eslint-plugin-jsx-a11y'; import i18next from 'eslint-plugin-i18next'; import i18nextHtmlEntities from 'eslint-plugin-i18next/lib/options/htmlEntities.js'; // ESLint 9 flat config. eslint-config-next 16 ships native flat configs and // peer-requires eslint >=9, so they are spread in directly (no FlatCompat). const eslintConfig = [ { ignores: [ '**/node_modules/**', '**/dist/**', '**/.next/**', '**/coverage/**', '**/build/**', '**/*.min.js', // Generated reports and vendored/CommonJS build scripts — not app source. 'e2e/playwright-report/**', 'apps/frontend/public/**', '**/*.cjs', ], }, ...nextCoreWebVitals, ...nextTypescript, { rules: { // Repo root is not the Next.js app (App Router lives in apps/frontend), // so this rule only emits a spurious "Pages directory cannot be found" notice. '@next/next/no-html-link-for-pages': 'off', // New in eslint-config-next 16.3: flags every location.assign/href to a // relative destination assuming an internal Next page. This app navigates // by full-page load DELIBERATELY for backend endpoints (/auth/logout) and // post-auth state resets — 17 sites, all intentional hard navigations. // The rule's assumption doesn't hold for this codebase. '@next/next/no-location-assign-relative-destination': 'off', 'react/no-unescaped-entities': 'off', // The following rules are globally disabled because the existing codebase // has a large volume of occurrences and fixing them safely is tracked // debt. They should be re-enabled incrementally per-area rather than in // one giant PR. See remediation runbooks L-01..L-08 and T-13. '@typescript-eslint/no-explicit-any': 'off', // BLOCKED: ~7,167 occurrences across 999 files — unsafe mass refactor '@typescript-eslint/no-unused-vars': 'off', // BLOCKED: ~1,106 occurrences across 451 files — many intentional destructurings 'react/display-name': 'error', // re-enabled TD-01c '@typescript-eslint/ban-ts-comment': 'off', // BLOCKED: ~189 ts-ignore comments across 76 files — needs per-site verification '@typescript-eslint/no-empty-object-type': 'error', // re-enabled TD-01e '@typescript-eslint/prefer-as-const': 'error', // already enabled TD-01f '@typescript-eslint/no-non-null-asserted-optional-chain': 'off', // BLOCKED: ~98 occurrences across 22 files incl. core services/provider adapters // React Compiler rule: 108 occurrences across 42 frontend files. Each fix // requires careful dependency review to avoid breaking memoization semantics. // Tracked debt (L-02 / F-07); downgrade to warn so CI stays green while the // debt remains visible. 'react-hooks/preserve-manual-memoization': 'warn', // BLOCKED: ~108 occurrences across 42 files — careful memoization review required }, }, { // Accessibility rules for the Next.js frontend. eslint-config-next already // registers the jsx-a11y plugin, so only its recommended ruleset is turned // on here (scoped to the frontend source). files: ['apps/frontend/src/**/*.{js,jsx,ts,tsx}'], rules: { ...jsxA11y.configs.recommended.rules, // High-volume rules that can't be safely auto-fixed are tracked as // warnings (visible, non-blocking) instead of being silently disabled: // - the click-on-
pattern is pervasive and each fix needs a real // keyboard handler / element change (tracked debt); // -