Skip to content

refactor(email): add explicit return types to email send functions (3 of 4)#1561

Merged
jeanduplessis merged 1 commit intomainfrom
refactor/eradicate-eslint-3-email
Mar 26, 2026
Merged

refactor(email): add explicit return types to email send functions (3 of 4)#1561
jeanduplessis merged 1 commit intomainfrom
refactor/eradicate-eslint-3-email

Conversation

@jeanduplessis
Copy link
Copy Markdown
Contributor

@jeanduplessis jeanduplessis commented Mar 25, 2026

Summary

PR series: 3 of 4 — merge in order: #1559 oxlint → #1560 CI → this PR#1562 trpc
(This PR is independent of #1559 and #1560 and can merge in parallel with them.)

Add explicit return type annotations to all email send functions for tsgo 7.0 compatibility:

  • tsgo 7.0 enforces TS2883, which requires explicit return types when the inferred type references non-portable vendor types
  • Wrapper functions (e.g. sendOrgSubscriptionEmail) now declare Promise<SendResult> instead of relying on inference from send()
  • sendViaMailgun now returns Promise<boolean> (true = sent, false = not configured) instead of leaking the mailgun client response type

Verification

  • scripts/typecheck-all.sh --changes-only — pass
  • pnpm format:check — pass

Visual Changes

N/A

Reviewer Notes

  • This is a prerequisite for refactor(trpc): migrate declaration emit to tsgo and stop committing dist #1562 which switches the packages/trpc build from tsc to tsgo. Without explicit return types, tsgo fails to emit declarations for the email functions.
  • The SendResult type ({ sent: true } | { sent: false; reason: ... }) was introduced by the NeverBounce PR. The wrapper functions previously had no explicit return type, so they inferred the mailgun/CIO vendor types which tsgo rejects.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Mar 25, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • src/lib/email-mailgun.ts
  • src/lib/email.ts

Reviewed by gpt-5.4-20260305 · 1,011,248 tokens

@jeanduplessis jeanduplessis self-assigned this Mar 25, 2026
tsgo 7.0 enforces TS2883 which requires explicit return type annotations
when the inferred type references non-portable vendor types. Add explicit
return types to email send functions using the existing SendResult type,
and change sendViaMailgun to return Promise<boolean> instead of leaking
the mailgun client type through declarations.
@jeanduplessis jeanduplessis force-pushed the refactor/eradicate-eslint-3-email branch from 7a13ba8 to 2c3cd6d Compare March 25, 2026 21:33
@jeanduplessis jeanduplessis merged commit 92cf4c6 into main Mar 26, 2026
19 checks passed
@jeanduplessis jeanduplessis deleted the refactor/eradicate-eslint-3-email branch March 26, 2026 00:09
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.

2 participants