Skip to content

fix(core): reject package versions and file names as emails - #168

Merged
sam247 merged 1 commit into
sam247:mainfrom
BilliamBaSH:fix/email-false-positives
Nov 12, 2026
Merged

sam247 merged 1 commit into
sam247:mainfrom
BilliamBaSH:fix/email-false-positives

Conversation

@BilliamBaSH

Copy link
Copy Markdown
Contributor

Summary

Fixes the email false positives from issue #165, where [email protected], types/[email protected], [email protected], [email protected] and [email protected] were flagged as email addresses.

Changes

  • validateEmail now needs the TLD to be two or more letters or punycode, which rules out the versions, the price and acme.123.
  • It also rejects a short list of image extensions for [email protected]. The list is a judgment call; none of them is a real TLD, and I left out ones that are, like .zip and .mov.
  • An address at a bare IP like [email protected] is no longer reported as an email, and direct callers of validateEmail get the stricter check too.
  • Tests for the five inputs and for addresses that should still pass, plus a patch changeset.

Testing

  • npm test
  • npm run lint
  • Other (describe): bun run typecheck and bun run consumer-smoke pass, and the full test run passes on Node 22 and 24.

Checklist

  • Added/updated tests
  • Updated documentation
  • Checked for breaking changes and documented migration steps if needed
  • Linked any relevant issues

Require a letters-only or punycode TLD in validateEmail and skip image file names.
Fixes the false positives reported in sam247#165.
@vercel

vercel Bot commented Nov 12, 2026

Copy link
Copy Markdown

@BilliamBaSH is attempting to deploy a commit to the Sam Pettiford's projects Team on Vercel.

A member of the Team first needs to authorize it.

@sam247
sam247 merged commit 6b98c19 into sam247:main Nov 12, 2026
9 of 10 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 12, 2026
@BilliamBaSH
BilliamBaSH deleted the fix/email-false-positives branch November 26, 2026 09:52
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