Skip to content

refactor(src/lib): 3 - convert remaining JS files to TypeScript - #137

Draft
sukhada wants to merge 1 commit into
claude/lib-cleanup-2cfrom
claude/lib-cleanup-3
Draft

refactor(src/lib): 3 - convert remaining JS files to TypeScript#137
sukhada wants to merge 1 commit into
claude/lib-cleanup-2cfrom
claude/lib-cleanup-3

Conversation

@sukhada

@sukhada sukhada commented Mar 23, 2026

Copy link
Copy Markdown

Summary

Converts all 6 remaining .js files in src/lib/ to TypeScript and adds stricter ESLint rules for the directory.

Conversions:

  • constants.js.ts (trivial rename)
  • is-client.js.ts (add return type)
  • request-logging.js.ts (add Express types for handler params)
  • zip-format.js.ts (add ZipRange tuple type, typed params/returns)
  • timezones.js.ts (add ContactWithTimezone/CampaignWithHours interfaces)
  • interaction-step-helpers.js.ts (add BaseInteractionStep/TreeNode interfaces, simplify to single path since isModel dead code was removed in PR 1a)

ESLint override for src/lib/**/*.ts:

  • @typescript-eslint/no-explicit-any: error
  • @typescript-eslint/explicit-module-boundary-types: error

Test updates:

  • Remove interactionStepForId tests (function deleted in PR 1a)
  • Update getTopMostParent calls to match simplified single-arg signature

src/lib/ is now 100% TypeScript — zero .js files remain.

Stacked on: #136

Test plan

  • 104 tests pass (102 pass, 2 skipped for known zip-format bug tracked for PR 4)
  • Lint and prettier clean
  • CI passes

🤖 Generated with Claude Code

Convert all 6 remaining .js files in src/lib/ to TypeScript:
- constants.js → constants.ts (trivial rename)
- is-client.js → is-client.ts (add return type)
- request-logging.js → request-logging.ts (add express types)
- zip-format.js → zip-format.ts (add ZipRange type, typed params)
- timezones.js → timezones.ts (add interface types for contact/campaign)
- interaction-step-helpers.js → interaction-step-helpers.ts (add
  BaseInteractionStep/TreeNode interfaces, remove isModel param since
  only GraphQL path is used after dead code removal in PR 1a)

Add ESLint override for src/lib/**/*.ts enforcing:
- @typescript-eslint/no-explicit-any: error
- @typescript-eslint/explicit-module-boundary-types: error

Update interaction-step-helpers.spec.ts to remove tests for
interactionStepForId (deleted in PR 1a) and update getTopMostParent
calls to match new single-arg signature.

src/lib/ is now 100% TypeScript — zero .js files remain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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