Why
The dashboard currently builds, but pnpm lint fails. This means a future CI gate would be red immediately and the current React hook issues can hide real runtime bugs.
Evidence
Local pnpm lint failures:
dashboard/src/auth/AuthProvider.tsx:14: react-refresh/only-export-components because the context is exported from the component module.
dashboard/src/auth/AuthProvider.tsx:41: react-hooks/set-state-in-effect around refreshUser().finally(() => setLoading(false)).
dashboard/src/billing/AccountPage.tsx:24: react-hooks/rules-of-hooks because useEffect is called after if (!user) return null.
There is also a React Compiler warning around TanStack Table in dashboard/src/components/StationTable.tsx:66.
Proposed work
- Move
AuthContext into a small separate module or otherwise satisfy Fast Refresh.
- Restructure
AuthProvider initialization so the effect does not synchronously cascade state updates in the flagged pattern.
- Move the
AccountPage early return below hooks, or split authenticated content into a child component.
- Decide whether to suppress/document the TanStack Table compiler warning or adjust the lint config for known incompatible-library cases.
Acceptance criteria
pnpm lint exits 0.
pnpm build still succeeds.
- Account page usage loading still works for authenticated users and renders nothing/redirects correctly for anonymous users.
Why
The dashboard currently builds, but
pnpm lintfails. This means a future CI gate would be red immediately and the current React hook issues can hide real runtime bugs.Evidence
Local
pnpm lintfailures:dashboard/src/auth/AuthProvider.tsx:14:react-refresh/only-export-componentsbecause the context is exported from the component module.dashboard/src/auth/AuthProvider.tsx:41:react-hooks/set-state-in-effectaroundrefreshUser().finally(() => setLoading(false)).dashboard/src/billing/AccountPage.tsx:24:react-hooks/rules-of-hooksbecauseuseEffectis called afterif (!user) return null.There is also a React Compiler warning around TanStack Table in
dashboard/src/components/StationTable.tsx:66.Proposed work
AuthContextinto a small separate module or otherwise satisfy Fast Refresh.AuthProviderinitialization so the effect does not synchronously cascade state updates in the flagged pattern.AccountPageearly return below hooks, or split authenticated content into a child component.Acceptance criteria
pnpm lintexits 0.pnpm buildstill succeeds.