Skip to content

Remove the as unknown as Bounty cast in bounty-card.tsx slot count #273

Description

@Benjtalkshow

components/bounty/bounty-card.tsx:232 reads the slot count with an ad-hoc cast:

{(bounty as unknown as Bounty).totalSlotsOccupied ?? 0} / {(bounty as unknown as Bounty).maxSlots ?? 5} slots

PR #263 added totalSlotsOccupied?: number | null and maxSlots?: number | null as optional fields on the Bounty interface. The cast is no longer needed.

What to do

  • Drop the two (bounty as unknown as Bounty) casts on line 232
  • If bounty is typed as BountyFieldsFragment, widen the prop type to BountyFieldsFragment & Partial<Bounty> to follow the same pattern used in bounty-detail-sidebar-cta.tsx and bounty-detail-mobile-cta.tsx
  • Confirm pnpm tsc --noEmit stays clean

Acceptance criteria

  • The two casts on bounty-card.tsx:232 are gone
  • No (bounty as unknown as Bounty) or (bounty as { ... }) casts remain in components/bounty/
  • pnpm tsc --noEmit and pnpm lint pass

Files

  • components/bounty/bounty-card.tsx

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions