JS.BASE.NO.DIV.REGEX
Disallow division operators explicitly at the beginning of regular expressions
Require regex literals to escape division operators.
Copy
function bar() { return /=foo/; }
Rule Details
This is used to disambiguate the division operator to not confuse users.
Examples of incorrect code for this rule:
Copy
/*eslint no-div-regex: "error"*/
function bar() { return /=foo/; }
Examples of correct code for this rule:
Copy
/*eslint no-div-regex: "error"*/
function bar() { return /[=]foo/; }