Improve Type Safety in cards.ts and Remove Remaining any Usage#579
Open
Facelessism wants to merge 1 commit into
Open
Improve Type Safety in cards.ts and Remove Remaining any Usage#579Facelessism wants to merge 1 commit into
Facelessism wants to merge 1 commit into
Conversation
Signed-off-by: lost_fanatic <bighna2005@gmail.com>
|
@Facelessism is attempting to deploy a commit to the Prashantkumar Khatri's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @Facelessism, Thanks for opening this pull request. This PR has been automatically classified based on the files modified. Applied Labels
Primary Review Area
Reviewer@Harxhit has been identified as the primary reviewer for this pull request. If you have any questions regarding the affected area or implementation details, feel free to reach out to the assigned reviewer. Thank you for your contribution! |
CI — All Checks PassedBackend — PASS
Mobile — SKIP
Web — SKIP
Last updated: |
Author
|
Hey @Harxhit |
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.
Summary
This PR improves type safety in
cards.tsby removing the remaining usages ofanyand replacing them with existing Fastify/JWT typings that's already available in the codebase. Auth-related type assertions have been eliminated, error handling has been made safer through an explicit type narrowing and a shared Fastify/JWT definitions are now reused where applicable.Closes #547
Type of Change
What Changed
anyusages fromsrc/routes/cards.tsrequest.server as anyand(app as any).authenticatewith properly typed fastify decorator accessrequest.userand auth related logiccatch (error: any)with safer error handling using explicit type narrowingHow to Test
apps/backendnpm run typecheckand verify it completes without any errorsChecklist
pnpm -r run lintpasses).pnpm -r run typecheck).pnpm -r run test).console.logor debug statements left in the code.Screenshots / Recordings
Additional Context