Files
websitedev/proto/eslint.config.mjs
Do SikiandClaude Sonnet 5 6cb99f603a chore(deps): upgrade Next.js to 16.3.4 for Payload CMS compatibility
Payload 3.88.0's peer range for `next` is >=15.2.9 <15.3.0 ||
>=15.3.9 <15.4.0 || >=15.4.11 <15.5.0 || >=16.2.6 <17.0.0 — the
project's previous 15.5.23 fell in the unsupported gap between the
15.4.x and 16.2.x ranges. Upgrading to 16.3.4 (React 19.1.0 stays
compatible) unblocks MITHOME-86.

- next.config.ts: drop the removed `eslint.ignoreDuringBuilds` option
  (Next 16 no longer runs ESLint during `next build`)
- eslint.config.mjs: import eslint-config-next's native flat-config
  arrays directly instead of bridging through FlatCompat, which threw
  "Converting circular structure to JSON" under ESLint 9 with the
  upgraded config
- tsconfig.json: Next 16's own migration set `jsx: react-jsx` and added
  `.next/dev/types/**/*.ts` to `include`
- ThemeProvider.tsx: suppress two react-hooks/set-state-in-effect
  false positives (new rule shipped with eslint-config-next 16) —
  these effects intentionally sync state from localStorage/DOM on
  mount, there is no subscription to move the setState into

Verified: npm run build, npm run lint, tsc --noEmit, npm test (58
passed) all clean on this change alone, before installing Payload.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 03:04:54 +02:00

43 lines
1.4 KiB
JavaScript
Executable File

// 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;