eslint: Fix unicorn/better-regex.

https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/better-regex.md

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-10-07 03:37:15 -07:00
committed by Tim Abbott
parent a37616e8c6
commit 0042cf51c1
12 changed files with 33 additions and 33 deletions

View File

@@ -68,7 +68,7 @@ function is_local_part(value, element) {
// Adapted from Django's EmailValidator
return (
this.optional(element) ||
/^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$/i.test(value)
/^[\w!#$%&'*+/=?^`{|}~-]+(\.[\w!#$%&'*+/=?^`{|}~-]+)*$/i.test(value)
);
}