fix: replace any types with proper types across codebase

Replace ~100 `any` usages with proper types: use existing interfaces
(RecipeModelType, BriefRecipeType, IPayment, etc.), Record<string, unknown>
for dynamic objects, unknown for catch clauses with proper narrowing,
and inline types for callbacks. Remaining `any` types are in Svelte
components and cases where mongoose document mutation requires casts.
This commit is contained in:
2026-03-02 20:14:51 +01:00
parent 66ce624cd5
commit 92460486de
37 changed files with 236 additions and 146 deletions

View File

@@ -219,8 +219,8 @@ export const actions: Actions = {
// Success - redirect to dashboard
throw redirect(303, '/cospend');
} catch (error: any) {
if (error.status === 303) throw error; // Re-throw redirect
} catch (error: unknown) {
if (error && typeof error === 'object' && 'status' in error && (error as { status: number }).status === 303) throw error; // Re-throw redirect
console.error('Error creating payment:', error);
return fail(500, {

View File

@@ -114,13 +114,14 @@ export const actions: Actions = {
// Redirect back to dashboard on success
throw redirect(303, '/cospend');
} catch (error: any) {
if (error.status === 303) {
} catch (error: unknown) {
if (error && typeof error === 'object' && 'status' in error && (error as { status: number }).status === 303) {
throw error; // Re-throw redirect
}
const message = error instanceof Error ? error.message : String(error);
return fail(500, {
error: error.message,
error: message,
values: {
settlementType,
fromUser,