-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Description
Describe the bug
When running the dashboard page, ESLint reports multiple errors:
- React Hook "useMemo" is called conditionally. React Hooks must be called in the exact same order in every component render.
- Prettier formatting issues appear in JSX files, especially with quotes and spacing.
This causes build failures and prevents proper linting.
To Reproduce
Steps to reproduce the behavior:
- Run the app or build the frontend:
npm run build - Observe ESLint errors about conditional hooks.
- Also notice Prettier formatting warnings when saving JSX/TSX files.
Expected behavior
- All React hooks should be called in the same order on every render to comply with rules-of-hooks.
- JSX code should pass Prettier formatting rules, e.g., quotes escaped correctly, spacing consistent.
- No build or linting errors should appear.
Screenshots
If applicable, include screenshots of terminal showing:
- react-hooks/rules-of-hooks errors
- Prettier formatting errors
Desktop (please complete the following information):
- OS: Windows 11
- Browser Chrome / Edge (if relevant)
- Version Node.js 20+, Next.js 13+
Smartphone (please complete the following information):
- Device: N/A
- OS: N/A
- Browser N/A
- Version N/A
Additional context
- The issue was caused by early returns before hooks in DashboardPage and other components.
- Prettier warnings mostly involve unescaped quotes in JSX.
- Fix involves:
- Refactoring hooks to always execute in the same order.
- Escaping quotes in JSX strings.
- Running Prettier on all affected files.
Metadata
Metadata
Assignees
Labels
No labels