Commit 13f814a
chore(cleanup): delete dead code (commented-out blocks + orphaned exports) (#193)
Two known scraps + four exports that ts-prune flagged as unreferenced
(verified by hand). Nothing here changes runtime behavior.
Commented-out scaffolding (from the original cleanup plan):
- src/app/layout.tsx — Geist font imports + const declarations sat
commented with a "temporarily disabled for build" note. Even fully
uncommented they wouldn't have re-enabled the font (the body className
uses `font-sans antialiased`, not the geist variables). Re-adding
Geist later is a fresh task; the commented placeholder was just rot.
- src/app/stations/[id]/edit/page.tsx — `// const [testingLotw,
setTestingLotw] = useState(false); // Unused - for future LoTW
validation`. The "future" comment had no path; if it ever lands,
add the state then.
Orphaned exports (zero references in src/, verified with git grep):
- src/lib/qrz.ts `validateQRZCredentials` — explicitly marked "(legacy)"
in its own comment; superseded by validateQRZApiKey. Delete the legacy.
- src/components/LotwSyncIndicator.tsx `LotwStatusBadge` — sibling
helper appended after the main component, never imported anywhere.
- src/components/QRZSyncIndicator.tsx `QRZStatusBadge` — same pattern.
- src/components/LotwSettings.tsx — entire file unused (no import sites).
Removing the two badge helpers freed up the `Badge` import in both
LotwSyncIndicator.tsx and QRZSyncIndicator.tsx; dropped those too.
Intentionally kept (ts-prune flagged, but architecturally meaningful):
- Auth helpers: requireAuth, requireAdmin, withApiAuth
- Permission helpers: isAdmin, isModerator, getRolePermissions
- API utilities: successWithRateLimit, errorResponse, corsJsonResponse
- Settings CRUD: getSetting, getSettingsByCategory, createSetting,
deleteSetting, SettingValue
- Type exports across types/awards.ts and models/
These are utility-belt/scaffolding code with clear architectural intent
(the auth and settings systems are partly wired). Deleting them removes
affordances; if they stay unused indefinitely they can be revisited.
Verification: lint baseline drops 52→51 (one LotwSettings React hooks
warning is gone), typecheck clean, build succeeds.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c277e33 commit 13f814a
6 files changed
Lines changed: 0 additions & 606 deletions
File tree
- src
- app
- stations/[id]/edit
- components
- lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 8 | | |
21 | 9 | | |
22 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | 135 | | |
137 | 136 | | |
138 | 137 | | |
| |||
0 commit comments