disallow standalone backslashes (
# 📖 Rule Details
This rule disallows backslash (
\) without escape.
E.g. the regular expression
/\c/ without the unicode (
u) flag is the same pattern as
In most cases, standalone backslashes are used by accident when a control escape sequence (
\cX) or another escape sequence was intended. They are very confusing and should not be used intentionally.
This behavior is described in Annex B (opens new window) of the ECMAScript specification.
# 🔧 Options
# 👫 Related rules
# 📚 Further reading
- ECMAScript® 2022 Language Specification > Annex B > B.1.4 Regular Expressions Patterns (opens new window)
# 🚀 Version
This rule was introduced in eslint-plugin-regexp v0.10.0