refactor: enhance type safety by replacing any types with stricter types across the codebase, improving error handling and reducing potential bugs

This commit is contained in:
Usman Baig
2026-02-22 20:29:16 +01:00
parent 1947c6a886
commit 06f54176f1
15 changed files with 94 additions and 65 deletions

View File

@@ -150,8 +150,7 @@ export default function PricingSection() {
// Helper to get all price details
const getPriceDetails = (planId: string) => {
// @ts-ignore
const basePrice = currentTraffic.prices[planId]
const basePrice = currentTraffic.prices[planId as keyof typeof currentTraffic.prices]
// Handle "Custom"
if (basePrice === null || basePrice === undefined) return null
@@ -203,7 +202,7 @@ export default function PricingSection() {
throw new Error('No checkout URL returned')
}
} catch (error: any) {
} catch (error: unknown) {
console.error('Checkout error:', error)
toast.error('Failed to start checkout — please try again')
} finally {