import { defineConfig, globalIgnores } from "eslint/config"; import nextVitals from "eslint-config-next/core-web-vitals"; import nextTs from "eslint-config-next/typescript"; // Next.js 16's own flat configs (no more FlatCompat / eslintrc). Run with `npm run lint` // (`next lint` was removed in Next 16). const eslintConfig = defineConfig([ ...nextVitals, ...nextTs, { // The React Compiler rules (set-state-in-effect, purity, immutability, refs, // static-components) are errors, as eslint-plugin-react-hooks 7 sets them (back on in 2.0). // Loading data or reading the browser in an effect: useExternalEffect; state that follows // other state: useStateSync (both in lib/hooks.ts) — see HANDOVER, "Next.js 16". rules: { // Those two take deps like useEffect; check them the same way. "react-hooks/exhaustive-deps": ["warn", { additionalHooks: "^(useExternalEffect|useStateSync)$" }], }, }, globalIgnores([".next/**", ".next-*/**", "out/**", "build/**", "next-env.d.ts", "src/lib/api-v2/schema.d.ts"]), ]); export default eslintConfig;