Skip to content

Tighten type usage: replace lazy any/unknown with true types #5

@reaatech

Description

@reaatech

Tighten type usage — replace lazy any / unknown with true types

Scan all TypeScript source under packages/**/src/ (and any root src/) and tighten type usage to honest, precise types. This is a type-safety / tech-debt cleanup — preserve runtime behavior, change only the types.

Rules:

  • Replace unknown with its true type. Keep unknown only where the value is genuinely unknown at compile time — e.g. parsed external JSON before validation, catch (e: unknown) clauses, or a deliberately dynamic public boundary. Lazy unknown used to dodge typing is not acceptable.
  • Replace any with its true type — or with unknown only if genuinely unknown. Never leave any.
  • This includes annotations (: any, : unknown), assertions (as any, as unknown as T), and generic args.

Acceptance:

  • pnpm typecheck passes (no new errors, no @ts-ignore/@ts-expect-error added to paper over).
  • pnpm lint passes (no new biome-ignore / eslint-disable).
  • Tests still pass; no behavioral change.

Where a value really is unknown at the boundary, narrow it with a type guard or schema validation rather than asserting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions