Skip to content

refactor(src/lib): 1a - remove dead code - #132

Draft
sukhada wants to merge 1 commit into
mainfrom
claude/lib-cleanup-1a
Draft

refactor(src/lib): 1a - remove dead code#132
sukhada wants to merge 1 commit into
mainfrom
claude/lib-cleanup-1a

Conversation

@sukhada

@sukhada sukhada commented Mar 21, 2026

Copy link
Copy Markdown

Summary

Phase 1A of the modernization effort scoped specifically to the src/lib directory. Dead code identified via ts-prune + manual grep verification across all production code (excluding tests).

Deletions (-214 lines):

  • dst-helper.js + its test — unused outside its own test; hand-rolls DST detection that luxon does natively
  • js-types.ts — misleading types (TruthyString includes falsy values); inlined into the 2 consuming files with better names
  • __mocks__/ directory — redundant; jest.mock() auto-mocks without needing manual mock files
  • getInteractionTree — never imported outside barrel
  • getDisplayPhoneNumber — never imported outside barrel
  • getCommonZipRanges — never imported outside barrel
  • timezonecomplete dependency — only consumer was dst-helper.js

Unexported (internal-only):

  • getHighestRole — only used by hasRole() within permissions.ts
  • downloadFromUrl — only used by withTempDownload() within utils.ts

Verification method: ts-prune --project tsconfig.json flagged candidates. Each was then verified with grep across the full codebase (excluding test/spec files and barrel re-exports) to confirm zero production consumers.

Test plan

  • All 25 existing src/lib/ tests pass
  • Lint and prettier clean
  • CI passes

🤖 Generated with Claude Code

@sukhada
sukhada force-pushed the claude/lib-cleanup-1a branch from e654bde to f4fdbcf Compare March 21, 2026 23:10
Dead code identified via ts-prune + manual grep verification.

Deletions:
- dst-helper.js + test: unused outside its own test, hand-rolls DST
  detection that luxon does natively
- js-types.ts: misleading types (TruthyString includes falsy values),
  inlined into the 2 consuming files with better names
- __mocks__/ directory: redundant with jest.mock() auto-mocking
- getInteractionTree: never imported outside barrel
- getDisplayPhoneNumber: never imported outside barrel
- getCommonZipRanges: never imported outside barrel
- timezonecomplete dependency: only consumer was dst-helper

Unexported (internal-only):
- getHighestRole: only used by hasRole() within permissions.ts
- downloadFromUrl: only used by withTempDownload() within utils.ts

Removed unused lodash import from index.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sukhada
sukhada force-pushed the claude/lib-cleanup-1a branch from f4fdbcf to 156e0d9 Compare March 21, 2026 23:12
@sukhada sukhada changed the title refactor: remove dead code from src/lib/ refactor(1a): remove dead code from src/lib/ Mar 21, 2026
@sukhada sukhada changed the title refactor(1a): remove dead code from src/lib/ refactor(src/lib): 1a - remove dead code Mar 21, 2026
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