Summary
src/lib/api.ts lines 7-8:
// Re-export for backward compat with existing imports
export type { Product, Policy };
These types are defined in src/types/index.ts and re-exported from api.ts. This creates two valid import paths for the same type:
import type { Product } from '@/types'; // canonical
import type { Product } from '@/lib/api'; // also works (re-export)
The comment says "backward compat" suggesting this was a migration shim that was never cleaned up. Mixing import paths means:
- IDEs show two definitions when navigating to the type
- The TypeScript project's type graph has an extra indirection
- New contributors are uncertain which path to use
- If
api.ts is ever split, this shim must be remembered and moved
Acceptance criteria
Summary
src/lib/api.tslines 7-8:These types are defined in
src/types/index.tsand re-exported fromapi.ts. This creates two valid import paths for the same type:The comment says "backward compat" suggesting this was a migration shim that was never cleaned up. Mixing import paths means:
api.tsis ever split, this shim must be remembered and movedAcceptance criteria
import type { Product, Policy } from '@/lib/api'across the codebase are migrated to'@/types'api.tsare removed