prefer predefined assertion over equivalent lookarounds
- ⚙️ This rule is included in
- 🔧 The
--fixoption on the command line (opens new window) can automatically fix some of the problems reported by this rule.
# 📖 Rule Details
All predefined assertions (
$) can be expressed as lookaheads and lookbehinds. E.g.
/a$/ is the same as
In most cases, it's better to use the predefined assertions because they are better known.
# 🔧 Options
# 🚀 Version
This rule was introduced in eslint-plugin-regexp v0.10.0