// NOTE (Next.js 16 / eslint-config-next 16): the FlatCompat("next/core-web-vitals") // bridge to the legacy .eslintrc-style config caused a circular-JSON crash in // ESLint 9 (the "react" plugin object closes a cycle when re-validated through // FlatCompat). eslint-config-next now ships native flat-config arrays, so // import those directly instead of going through the compat layer. import nextCoreWebVitals from "eslint-config-next/core-web-vitals"; import nextTypescript from "eslint-config-next/typescript"; const eslintConfig = [ ...nextCoreWebVitals, ...nextTypescript, { ignores: [ "node_modules/**", ".next/**", "out/**", "build/**", "next-env.d.ts", ], }, { // WHY: test suites legitimately use `any` mocks, jest globals and CommonJS // require(); jest/playwright config files are CommonJS by design. Relax the // strict rules there so lint failures point at real production-code issues. files: [ "**/*.test.ts", "**/*.test.tsx", "jest.config*.js", "jest.setup*.js", "jest.globalSetup*.js", "playwright.config.ts", ], rules: { "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-require-imports": "off", "@typescript-eslint/no-unused-vars": "off", "react/display-name": "off", }, }, ]; export default eslintConfig;