deno_lint logodeno_lint

All rules/no-invalid-regexp

Disallows specifying invalid regular expressions in RegExp constructors

Specifying an invalid regular expression literal will result in a SyntaxError at compile time, however specifying an invalid regular expression string in the RegExp constructor will only be discovered at runtime.


const invalidRegExp = new RegExp(")");


const goodRegExp = new RegExp(".");