💼 This rule is enabled in the following configs: 🟢 flat/recommended
, 🔵 recommended
.
📖 Rule Details disallow invalid regular expression strings in
RegExp
constructors
This rule reports invalid regular expression patterns given to RegExp
constructors.
no-invalid-regexp
rule
This rule is almost functionally equivalent to ESLint's no-invalid-regexp rule. The only difference is that this rule doesn't validate flags (see no-non-standard-flag).
There are two reasons we provide this rule:
Better error reporting.
Instead of reporting the whole invalid string, this rule will try to report the exact position of the syntax error.
Better support for complex constructor calls.
ESLint's rule only validates RegExp
constructors called with simple string literals. This rule also supports operations (e.g. string concatenation) and variables to some degree.
Nothing.
📚 Further reading 🚀 Version This rule was introduced in eslint-plugin-regexp v1.0.0
🔍 Implementation RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4