Skip to main content
Validates tel: and mailto: link formats
Rule IDlinks/tel-mailto
CategoryLinks
ScopePer-page
Severityinfo
Weight2/10

What it detects

  • Invalid tel: links — phone numbers missing digits or too short
  • Invalid mailto: links — email addresses missing @ or .
  • Tel href/text mismatch — the phone number in the href doesn’t match the displayed text (e.g. <a href="tel:+15551234567">+15559876543</a>). Comparison is formatting-insensitive and allows omitted country codes.
  • Mailto href/text mismatch — the email in the href doesn’t match the displayed text (e.g. <a href="mailto:sales@example.com">support@example.com</a>). Comparison is case-insensitive and ignores query parameters.

Solution

Tel links should use format: tel:+1234567890 (E.164 format preferred, no spaces/dashes). Mailto links should have valid email format: mailto:user@example.com. You can add subject and body parameters: mailto:user@example.com?subject=Hi&body=Hello. Invalid formats may not work on all devices. Ensure the displayed text matches the href — a mismatched phone number or email misleads users and may dial/email the wrong contact.

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["links/tel-mailto"]
squirrel.toml
[rules]
disable = ["links/*"]

Enable only this rule

squirrel.toml
[rules]
enable = ["links/tel-mailto"]
disable = ["*"]