Summary
Improve type safety in follow.ts by removing remaining usages of any and replacing them with proper Fastify, TypeScript, OAuth, and application-specific types.
Contexts
The follow routes currently contain several usages of any that bypass TypeScript's type checking and reduce maintainability.
Examples include:
const server = request.server as any;
(app as any).authenticate
(request as any).user = payload;
Some of these usages are related to authentication, OAuth integrations, request typing, and Fastify route handlers. Existing shared Fastify/JWT type definitions should be reused where available instead of introducing duplicate definitions.
Removing these usages will improve maintainability, reduce unsafe casts, and make future refactoring easier.
Tasks
Acceptance Criteria
Area
backend
Difficulty
Good First Issue
Summary
Improve type safety in
follow.tsby removing remaining usages ofanyand replacing them with proper Fastify, TypeScript, OAuth, and application-specific types.Contexts
The follow routes currently contain several usages of
anythat bypass TypeScript's type checking and reduce maintainability.Examples include:
Some of these usages are related to authentication, OAuth integrations, request typing, and Fastify route handlers. Existing shared Fastify/JWT type definitions should be reused where available instead of introducing duplicate definitions.
Removing these usages will improve maintainability, reduce unsafe casts, and make future refactoring easier.
Tasks
anyusages infollow.tsserver as anywith appropriate Fastify typesapp as anywith appropriate Fastify typesrequest.user as anywith properly typed user access(request as any).userwith proper request typingerror: anywith safer error handling patternsAcceptance Criteria
anyusages remain infollow.tsanyusageArea
backendDifficulty
Good First Issue