Skip to content

Fix dashboard lint failures blocking clean CI #11

Description

@semyonfox

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjavascriptPull requests that update javascript code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions