Requires the regex flags to be sorted.
configuration in plugin:clean-regex/recommended
: "warn"
The flags of JavaScript regular expressions should be sorted alphabetically
because the flags of the .flags
property of RegExp
objects are always
sorted. Not sorting flags in regex literals misleads readers into thinking that
the order may have some purpose which it doesn't.
Examples of valid code for this rule:
/abc/
/abc/iu
/abc/gimsuy
Examples of invalid code for this rule:
/abc/mi
/abc/us