Disallow alternatives without elements.
configuration in plugin:clean-regex/recommended
: "warn"
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.
Examples of valid code for this rule:
/(?:)/
/a+|b*/
Examples of invalid code for this rule:
/a+|b+|/
/\|\||\|||\|\|\|/
/a(?:a|bc|def|h||ij|k)/