feat: implement issue #665 — SonarCloud: JavaScript/TypeScript code quality

Merged
DO
4d ago
+218-4

Problem

SonarCloud: JavaScript/TypeScript code quality

From the issue: 1 open SonarCloud finding(s) in combsmith/google-app-scripts, worst severity MAJOR. Generated by the org SonarCloud Audit.

Risk

Low — 3 file(s) changed; no CI- or runtime-critical paths touched.

Test plan

Tests added/updated: src/gmail-ai-classifier/tests/sender-address.test.js. Verification: bash scripts/dev-lead-lint.sh (shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.

Rollback

Revert this PR. No non-revertible side effects (no tags, migrations, or external state).

Monitoring

This PR's CI checks (Lint + bats) are the success/regression signal.

Closes #665

Summary by CodeRabbit

  • Bug Fixes
    • Improved sender address extraction from varied sender text by scanning delimiter-separated entries for email addresses.
    • Extraction returns the first matching address in lowercase, or an empty result when no address is found.