💼 This rule is enabled in the ✅
💡 This rule is manually fixable by editor suggestions.
disallow assertions that are known to always accept (or reject)
📖 Rule Details
Some assertions are unnecessary because the rest of the pattern forces them to always be accept (or reject).
Right now, this rule is implemented by only looking a single character ahead and behind. This is enough to determine whether the builtin assertions (
$) trivially reject or accept but it is not enough for all lookarounds. The algorithm determining the characters ahead and behind is very conservative which can lead to false negatives.
This rule was introduced in eslint-plugin-regexp v0.9.0