# regexp/no-empty-alternative

disallow alternatives without elements

  • ⚙️ This rule is included in "plugin:regexp/recommended".

# 📖 Rule Details

While (re-)writing long regular expressions, it can happen that one forgets to remove the | character of a former alternative. This rule tries to point out these potential mistakes by reporting all empty alternatives.

Now loading...

# 🔧 Options

Nothing.

# ❤️ Compatibility

This rule was taken from eslint-plugin-clean-regex (opens new window).
This rule is compatible with clean-regex/no-empty-alternative (opens new window) rule.

# 🚀 Version

This rule was introduced in eslint-plugin-regexp v0.8.0

# 🔍 Implementation

Last Updated: 6/25/2022, 12:32:38 PM