chore(cleanup): delete dead code (commented blocks + orphaned exports) - #193
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two known commented-out scraps from the cleanup plan + four exports that
ts-pruneflagged as unreferenced (each verified by hand withgit 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 usesfont-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 byvalidateQRZApiKey.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
Badgeimport in both indicator files; dropped those.Intentionally kept (ts-prune flagged but architecturally meaningful)
requireAuth,requireAdmin,withApiAuthisAdmin,isModerator,getRolePermissionssuccessWithRateLimit,errorResponse,corsJsonResponsegetSetting,getSettingsByCategory,createSetting,deleteSetting,SettingValuetypes/awards.tsandmodels/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; oneLotwSettingsReact hooks warning is gone with the file)npm run typecheck— cleannpm run build— succeeds/search— confirm sync indicators (LotwSyncIndicator,QRZSyncIndicator) still render correctly/and/login— confirm font/layout look unchanged (body uses Tailwind'sfont-sans)🤖 Generated with Claude Code