- The 192 places the rules flagged are fixed and the rules are errors again (npx eslint src: nothing). lib/hooks.ts: useStateSync (state that follows other state, set while rendering), useExternalEffect (API loads and browser reads), useNow; lib/navigation.ts hardNavigate for full reloads after sign-out or identity switches; other pages use the router. Resets moved into the handlers that cause them. - The banner shows and hides at its times on open pages. - HANDOVER, roadmap, README, FEATURES, SETTINGS, CHANGELOG updated; 2.0.0 section drafted in WHATS-NEW. e2e 102/102 (PayFast sandbox skipped); production build passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.1 KiB
JavaScript
24 lines
1.1 KiB
JavaScript
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;
|