Skip to content

refactor: replace any types with concrete types - #206

Merged
Glittersup merged 1 commit into
TricklePay:mainfrom
abimbolaalabi:refactor/issue-155
Sep 2, 2026
Merged

refactor: replace any types with concrete types#206
Glittersup merged 1 commit into
TricklePay:mainfrom
abimbolaalabi:refactor/issue-155

Conversation

@abimbolaalabi

Copy link
Copy Markdown
Contributor

Overview

This PR replaces the remaining any type annotations with concrete types (or unknown plus narrowing), so external data entry points stay type-checked. A few test mocks and helpers fell back to any, disabling checking exactly where assumptions are made.

While verifying the checks required by this issue, npm run build exposed a pre-existing Next.js build break on main (the StreamDetail named export in a route file), so this PR also fixes that so the typecheck and build gates both pass.

Related Issue

Closes #155

Changes

  • [MODIFY] components/header.test.tsxuseState: (initial: any)(initial: unknown).
  • [MODIFY] app/streams/[id]/page.test.tsxuseState: (initial: any)(initial: unknown); next/link mock children: anychildren: ReactNode.
  • [MODIFY] components/skeleton.test.tsx — type the Suspense render trees with concrete ReactElement<...> shapes (fixes the pre-existing typecheck failures from calling components directly under React 19 types).
  • [ADD] components/stream-detail.tsxStreamDetail (+ its Field helper) moved out of the route file.
  • [MODIFY] app/streams/[id]/page.tsx — drop the StreamDetail named export (Next.js route files may only export route-specific symbols), import it from the new component.
  • [MODIFY] components/skeleton.tsx — update the StreamDetailSkeleton comment to the new module location.

Verification Results

npm run lint
npm run typecheck
npm test
npm run build
  • npm run lint — passes (only 2 pre-existing warnings in lib/api-schema.test.ts).
  • npm run typecheck — passes cleanly (was failing on the pre-existing skeleton.test.tsx errors).
  • npm run build — passes, all 6 routes prerender (was failing on main due to the StreamDetail route-file export).
  • npm test — unchanged from baseline (same pre-existing environmental failures; no new failures).
Acceptance Criteria Status
Remaining any types are replaced with concrete types or unknown plus narrowing ✅ 0 remaining any annotations
The typecheck passes tsc --noEmit clean
No runtime behaviour changes ✅ Purely type-level changes; StreamDetail rendering unchanged

@drips-wave

drips-wave Bot commented Sep 1, 2026

Copy link
Copy Markdown

@abimbolaalabi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Glittersup
Glittersup merged commit dcf391f into TricklePay:main Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace remaining any types with concrete types

2 participants