rule prefer-named-capture-group should only be effective for ES9+ #14959
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
enhancement
This change enhances an existing feature of ESLint
rule
Relates to ESLint's core rules
What rule do you want to change?
prefer-named-capture-group
Does this change cause the rule to produce more or fewer warnings?
fewer warnings
How will the change be implemented? (New option, new default behaviour, etc.)?
new default behaviour
Please provide some example code that this change will affect:
use a replace statement with a numeric group reference in its replace pattern while using ES6 or any other ES version 1..8.
This will raise
Capture group '(yyy)' should be converted to a named or non-capturing group
, but named groups are not supported in ES6 and a non-capturing group is useless in this context.The use of ES6 was indicated by setting
eslintConfig.parserOptions.ecmaVersion
to 6 inpackage.json
.What does the rule currently do for this code?
The current rule currently suggests to use named capture groups, even while using an ES version where that is not supported.
What will the rule do after it's changed?
It will not report this for ES 1..8
Are you willing to submit a pull request to implement this change?
no, as I'm not skilled in the inner structure/workings of eslint.
The text was updated successfully, but these errors were encountered: