refactor: replace any types with concrete types - #206
Merged
Conversation
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR replaces the remaining
anytype annotations with concrete types (orunknownplus narrowing), so external data entry points stay type-checked. A few test mocks and helpers fell back toany, disabling checking exactly where assumptions are made.While verifying the checks required by this issue,
npm run buildexposed a pre-existing Next.js build break onmain(theStreamDetailnamed export in a route file), so this PR also fixes that so the typecheck and build gates both pass.Related Issue
Closes #155
Changes
components/header.test.tsx—useState: (initial: any)→(initial: unknown).app/streams/[id]/page.test.tsx—useState: (initial: any)→(initial: unknown);next/linkmockchildren: any→children: ReactNode.components/skeleton.test.tsx— type theSuspenserender trees with concreteReactElement<...>shapes (fixes the pre-existing typecheck failures from calling components directly under React 19 types).components/stream-detail.tsx—StreamDetail(+ itsFieldhelper) moved out of the route file.app/streams/[id]/page.tsx— drop theStreamDetailnamed export (Next.js route files may only export route-specific symbols), import it from the new component.components/skeleton.tsx— update theStreamDetailSkeletoncomment to the new module location.Verification Results
npm run lint— passes (only 2 pre-existing warnings inlib/api-schema.test.ts).npm run typecheck— passes cleanly (was failing on the pre-existingskeleton.test.tsxerrors).npm run build— passes, all 6 routes prerender (was failing onmaindue to theStreamDetailroute-file export).npm test— unchanged from baseline (same pre-existing environmental failures; no new failures).anyannotationstsc --noEmitcleanStreamDetailrendering unchanged