import nextCoreWebVitals from 'eslint-config-next/core-web-vitals'; import prettier from 'eslint-config-prettier/flat'; const eslintConfig = [ ...nextCoreWebVitals, prettier, { rules: { '@typescript-eslint/no-explicit-any': 'error', '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], // React Compiler safety rules shipped with eslint-config-next@16 / // react-hooks@7. Triage status (2026-05-12 sweep): // purity, set-state-in-render, immutability, refs — promoted // back to error after the existing hits were cleaned up; new // regressions block CI. // set-state-in-effect — left as warn. Many hits are the // useEffect→fetch→setState data-loading pattern that the // Compiler conservatively flags but can't refactor without // moving each call site to TanStack Query. ~50 admin-form // land sites tracked in docs/BACKLOG.md §G. // incompatible-library — informational only ("Compiler // skipped this file because of a non-Compiler-safe import"). // No action needed; silenced to keep `pnpm lint` output // actionable. 'react-hooks/purity': 'error', 'react-hooks/set-state-in-render': 'error', 'react-hooks/immutability': 'error', 'react-hooks/refs': 'error', 'react-hooks/set-state-in-effect': 'warn', 'react-hooks/incompatible-library': 'off', }, }, { // Tests assert response shape via expect() — narrowing every // `res.json()` to a structural type adds boilerplate without catching // bugs. Allow `any` casts at JSON boundaries in test files. files: ['tests/**/*.ts', 'tests/**/*.tsx'], rules: { '@typescript-eslint/no-explicit-any': 'off', }, }, { ignores: ['client-portal/**', 'next-env.d.ts'], }, ]; export default eslintConfig;