Skip to content

chore(cleanup): delete dead code (commented blocks + orphaned exports) - #193

Merged
patrickrb merged 1 commit into
mainfrom
cleanup/dead-code
May 11, 2026
Merged

chore(cleanup): delete dead code (commented blocks + orphaned exports)#193
patrickrb merged 1 commit into
mainfrom
cleanup/dead-code

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

Summary

Two known commented-out scraps from the cleanup plan + four exports that ts-prune flagged as unreferenced (each verified by hand with git grep). Nothing here changes runtime behavior — it's all already-dead code.

Commented-out scaffolding

  • 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 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/)

  • src/lib/qrz.ts validateQRZCredentials — explicitly marked "(legacy)" in its own comment; superseded by validateQRZApiKey.
  • src/components/LotwSyncIndicator.tsx LotwStatusBadge — sibling helper appended after the main component, never imported.
  • src/components/QRZSyncIndicator.tsx QRZStatusBadge — same pattern.
  • src/components/LotwSettings.tsx — entire file unused (no import sites). 567-line component file deleted.

Removing the two badge helpers also freed the Badge import in both indicator files; dropped those.

Intentionally kept (ts-prune flagged but architecturally meaningful)

  • Auth helpers: requireAuth, requireAdmin, withApiAuth
  • Permission helpers: isAdmin, isModerator, getRolePermissions
  • API response 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. Revisit if they stay unused for another round of cleanups.

Test plan

  • npm run lint — 51 warnings (down 1 from baseline; one LotwSettings React hooks warning is gone with the file)
  • npm run typecheck — clean
  • npm run build — succeeds
  • Manual: view a contact row in /search — confirm sync indicators (LotwSyncIndicator, QRZSyncIndicator) still render correctly
  • Manual: load / and /login — confirm font/layout look unchanged (body uses Tailwind's font-sans)

🤖 Generated with Claude Code

…orts)

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>
@vercel

vercel Bot commented May 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodelog Ready Ready Preview, Comment May 11, 2026 1:16am

Request Review

@patrickrb
patrickrb merged commit 13f814a into main May 11, 2026
7 checks passed
@patrickrb
patrickrb deleted the cleanup/dead-code branch May 11, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant