Commit Graph

2 Commits

Author SHA1 Message Date
Charles de Dreuille ad435e4344 Fix React hooks ESLint errors without disabling rules
Refactored components to avoid synchronous setState calls in effects
by using proper React patterns:

- TableOfContents: Use requestAnimationFrame to defer setState calls
  and useLayoutEffect for DOM measurements
- CustomTheme: Use lazy state initialization for isClient and defer
  theme loading with requestAnimationFrame
- PlaygroundContext: Use lazy initialization for localStorage hydration

These changes maintain functionality while satisfying the strict
react-hooks/set-state-in-effect ESLint rule.

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-01-29 15:01:12 +00:00
Charles de Dreuille b9be9d33aa Upgrade to ESLint 9 for Next.js 16 compatibility
Next.js 16 requires ESLint 9 for proper flat config support. This commit:
- Upgrades eslint from ^8 to ^9
- Migrates from .eslintrc.json to eslint.config.mjs (flat config)
- Updates lint script to use eslint directly (next lint removed in Next.js 16)
- Adds tsconfig.json includes for Next.js 16 dev types
- Fixes layout.tsx to use proper theme CSS link tags

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-01-29 13:30:44 +00:00