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
components/bounty/bounty-card.tsx:232reads the slot count with an ad-hoc cast:PR #263 added
totalSlotsOccupied?: number | nullandmaxSlots?: number | nullas optional fields on theBountyinterface. The cast is no longer needed.What to do
(bounty as unknown as Bounty)casts on line 232bountyis typed asBountyFieldsFragment, widen the prop type toBountyFieldsFragment & Partial<Bounty>to follow the same pattern used inbounty-detail-sidebar-cta.tsxandbounty-detail-mobile-cta.tsxpnpm tsc --noEmitstays cleanAcceptance criteria
bounty-card.tsx:232are gone(bounty as unknown as Bounty)or(bounty as { ... })casts remain incomponents/bounty/pnpm tsc --noEmitandpnpm lintpassFiles
components/bounty/bounty-card.tsx