Disallow quantifiers with a maximum of 0.
configuration in plugin:clean-regex/recommended
: "error"
Quantifiers with a maximum of zero mean that the quantified element will never be matched. They essentially produce dead code.
Note: The rule will not remove zero-quantified elements if they are or contain a capturing group. In this case, the quantifier and element will simple be reported.
Examples of valid code for this rule:
/a{0,1}/;
Examples of invalid code for this rule:
/a{0}/;
/a{0,0}/;