Skip to content

Replace all 'as any' type assertions with proper TypeScript types #2128

@georgi

Description

@georgi

Problem

Many components use as any type assertions which bypass TypeScript's type checking and can hide bugs. These should be replaced with proper type definitions.

What to do

  1. Search for all as any in web/src/ (excluding test files)
  2. For each occurrence, determine the actual type and replace the assertion
  3. If a proper type doesn't exist yet, create an interface or type alias
  4. Common patterns to fix:
    • Event handlers: as anyas React.MouseEvent<HTMLButtonElement>
    • Store selectors: as any → proper state type
    • API responses: as any → response interface
    • Theme access: as anyas Theme

Important

  • Do NOT just replace as any with as unknown — that's equally bad
  • If you truly cannot determine the type, use a specific comment explaining why
  • Run npm run typecheck to verify your changes compile

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions