// 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", // Generated test output (Playwright report/traces, Jest coverage) — not source. "playwright-report/**", "test-results/**", "coverage/**", ], }, { // 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", // MITHOME-136: package is "type": "module", so the CommonJS jest files are .cjs. "jest.config*.cjs", "jest.setup*.cjs", "jest.globalSetup*.cjs", "jest.globalTeardown*.cjs", "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;