Files
pn-new-crm/eslint.config.mjs

42 lines
1.6 KiB
JavaScript
Raw Normal View History

2026-05-12 22:24:51 +02:00
import nextCoreWebVitals from 'eslint-config-next/core-web-vitals';
import prettier from 'eslint-config-prettier/flat';
const eslintConfig = [
2026-05-12 22:24:51 +02:00
...nextCoreWebVitals,
prettier,
{
rules: {
2026-05-12 22:24:51 +02:00
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
// React Compiler safety rules that ship with eslint-config-next@16 /
// react-hooks@7. These flag setState-in-effect, ref-during-render,
// and impurity patterns that the upcoming React Compiler will trip
// on. They surfaced ~73 hits in the existing codebase on the
// next-16 bump — all legitimate findings but a clean-up project
// worth a dedicated triage pass, not a blocker for the dep
// upgrade. Demoted to warnings so the suite stays visible without
// turning every commit red. Tracked in docs/BACKLOG.md §G.
'react-hooks/set-state-in-effect': 'warn',
'react-hooks/set-state-in-render': 'warn',
'react-hooks/refs': 'warn',
'react-hooks/immutability': 'warn',
'react-hooks/purity': 'warn',
'react-hooks/incompatible-library': 'warn',
},
},
{
// 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.
2026-05-12 22:24:51 +02:00
files: ['tests/**/*.ts', 'tests/**/*.tsx'],
rules: {
2026-05-12 22:24:51 +02:00
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
2026-05-12 22:24:51 +02:00
ignores: ['client-portal/**', 'next-env.d.ts'],
},
];
export default eslintConfig;