Reports backreferences in regular expressions that will always match empty or fail.
✅ This rule is included in the ts logical presets.
Reports backreferences in regular expressions that will always match empty or fail to match.
These backreferences are useless because they reference capturing groups that haven’t captured anything at the time the backreference is evaluated.
If you are intentionally using backreferences that match empty strings for specific pattern-matching logic, you might want to disable this rule.
However, in most cases, these patterns indicate a mistake in the regular expression.