Empty character classes should not be used in regular expressions
- No tags
This rule applies when a regular expression has empty character classes.
Because empty character classes '' in regular expressions do not match anything, they are not likely to be a programmer's intent.
Noncompliant Code ExampleView with compliant examples side by side
var foo = /^abc/;
Compliant Code ExampleView with noncompliant examples side by side
var foo = /^abc/; var bar = /^abc[a-z]/;
This rule was introduced in DeepScan 1.0.0-alpha.