1 # Require Regex Literals to be Wrapped (wrap-regex)
3 When a regular expression is used in certain situations, it can end up looking like a division operator. For example:
7 return /foo/.test("bar");
13 This is used to disambiguate the slash operator and facilitates more readable code.
15 Example of **incorrect** code for this rule:
18 /*eslint wrap-regex: "error"*/
21 return /foo/.test("bar");
25 Example of **correct** code for this rule:
28 /*eslint wrap-regex: "error"*/
31 return (/foo/).test("bar");