no-div-regex
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"no-div-regex": "error",
},
},
];Disallow equal signs explicitly at the beginning of regular expressions
function bar() { return /=foo/; }function bar() { return /[=]foo/; }Examples from the ESLint documentation.
no-div-regex
eslint
export default [
{
rules: {
"no-div-regex": "error",
},
},
];no-div-regex
eslint plugin · restriction
{
"rules": {
"no-div-regex": "error"
}
}complexity/noDivRegex
complexity · since 2.3.12
{
"linter": {
"rules": {
"complexity": {
"noDivRegex": "error"
}
}
}
}Disallow calls to the Object constructor without an argument
Enforce a maximum depth that callbacks can be nested
Enforce a maximum cyclomatic complexity allowed in a program
Enforce the use of u or v flag on regular expressions
Disallow use of Object.prototype.hasOwnProperty.call() and prefer use of Object.hasOwn()
Disallow declarations in the global scope