no-invalid-regexp rule doesn't error with example from its documentation
See original GitHub issueTell us about your environment
- ESLint Version: 5.6.0
- Node Version: 8.12.0
- npm Version: 6.3.0
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
{
"env": {
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 2017
},
"rules": {
"no-invalid-regexp": "error"
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
// like in the no-invalid-regexp documentation:
// https://github.com/eslint/eslint/blob/master/docs/rules/no-invalid-regexp.md#rule-details
new RegExp('\\');
eslint file.js
What did you expect to happen?
eslint failing with an error from the no-invalid-regexp
rule.
What actually happened? Please include the actual, raw output from ESLint.
eslint passed with no output.
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (12 by maintainers)
Top Results From Across the Web
no-invalid-regexp - ESLint - Pluggable JavaScript Linter
This rule disallows invalid regular expression strings in RegExp constructors. Examples of incorrect code for this rule: /*eslint no-invalid-regexp: "error"*/ ...
Read more >Regex for rules in CI/CD jobs does not work - GitLab
Summary Regex in the rule block of a CI job does not work. ... literal: '[' or a Gitlab CI error rules:rule if...
Read more >What flavor of Regex does Visual Studio Code use?
It'll complain with the error Invalid group . Apart from solving this specific issue, I'm looking for information about the flavor of Regexes...
Read more >SyntaxError: invalid regular expression flag "x" - MDN Web Docs
The JavaScript exception "invalid regular expression flag" occurs when the flags in a regular expression contain any flag that is not one ...
Read more >Regular Expression—ArcGIS Pro | Documentation
When a string is found that does not match the format or values specified, the table row is returned as an error. For...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sstern6 It looks like the fix has already been published as a new version of
regexpp
. https://github.com/eslint/eslint/pull/10920 has the effect of upgradingregexpp
and adding a test, as you suggested.I’m sorry, I misread it as
//
😅