Bug: `isEmail` docs/source suggest `allow_underscores` is defaulted to `false` however `[email protected]` is valid by default
As described in title.
I think this is expected behaviour. According to RFC 5322, an underscore can appear in the local-part of the email address and is a valid character (when used before @). The underscore is not allowed in the domain name; however, there are some cases where it could appear in a subdomain. This is what allow_underscores flag is for.
If you want to exclude underscore from local-part of the email, use blacklisted_chars option:
validator.isEmail('[email protected]', { blacklisted_chars: '_' }) // false
@jamro see https://github.com/validatorjs/validator.js/issues/2508
Given the expected behavior, I think we can go ahead and close this issue.
The docs and option indicate otherwise..