You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unexpected control character(s) in regular expression: \x0.
Disable the rule if the control character (\x... or \u00..) was intentional, otherwise rework your RegExp
deno-lint(no-control-regex)
Aside from the fact the warning is wrong (it's \x00, not \x0; also it doesn't trigger if \x7f is the only control char in the regex), regexes such as /[\x00-\x1f\x7f]/ are a somewhat common occurrence and a completely reasonable thing to want to write, particularly if you're doing something like parsing raw IO from stdin/stdout.
Alternatively: change the rule to only trigger for control character literals, which impede readability due to rendering as tofu in most fonts, and are much more likely to be there erroneously, whether in regexes or elsewhere.
The text was updated successfully, but these errors were encountered:
The regex
/[\x00-\x1f\x7f]/
gives this warning:Aside from the fact the warning is wrong (it's
\x00
, not\x0
; also it doesn't trigger if\x7f
is the only control char in the regex), regexes such as/[\x00-\x1f\x7f]/
are a somewhat common occurrence and a completely reasonable thing to want to write, particularly if you're doing something like parsing raw IO fromstdin
/stdout
.Alternatively: change the rule to only trigger for control character literals, which impede readability due to rendering as tofu in most fonts, and are much more likely to be there erroneously, whether in regexes or elsewhere.
The text was updated successfully, but these errors were encountered: