Files
backstage/docs-ui/eslint.config.mjs
T
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

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;