ad435e4344
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>
17 lines
416 B
JavaScript
17 lines
416 B
JavaScript
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
import nextCoreWebVitals from 'eslint-config-next/core-web-vitals';
|
|
|
|
const eslintConfig = defineConfig([
|
|
...nextCoreWebVitals,
|
|
globalIgnores(['.next/**', 'dist/**', 'node_modules/**']),
|
|
{
|
|
rules: {
|
|
'notice/notice': 'off',
|
|
'react/forbid-elements': 'off',
|
|
'jsx-a11y/alt-text': 'off',
|
|
},
|
|
},
|
|
]);
|
|
|
|
export default eslintConfig;
|