-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Tighten TypeScript types by replacing any with precise types or safe generics to improve safety and readability.
Context
Several any usages weaken type safety:
- src/layouts/DashboardLayout.tsx: NavItemProps.icon: any (should be IconType or ComponentType).
- src/types/api.types.ts: WebSocketMessage.payload: any (should be a discriminated union or generic).
- src/components/space/EditSpace.tsx: any in element lookups/mapping.
- catch(error: any) patterns across components and API helpers.
Tasks
- Replace any in NavItemProps.icon with IconType (from react-icons) or React.ComponentType.
- Model WebSocketMessage as a discriminated union keyed by type, each with a typed payload.
- Add proper types for element lookups in EditSpace (derive from Element/Space types).
- Update catch clauses to use unknown and narrow to AxiosError/Error as appropriate.
- Add minimal utility types where needed; avoid broad type assertions.
Acceptance Criteria
- npm run lint passes with no-explicit-any satisfied for modified files.
- No new type errors (tsc -b).
- App flows (auth, dashboard, space edit) work as before.
Notes
- Favor narrowing and generics over casting; keep changes scoped and incremental.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request