Rule Change: prefer-named-capture-group: add suggestion fixer #16530
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
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
Projects
What rule do you want to change?
prefer-named-capture-group
What change to do you want to make?
Implement suggestions
How do you think the change should be implemented?
A new default behavior
Example code
What does the rule currently do for this code?
It reports a complaint on the regular expression:
/
([^]*)
/gi`What will the rule do after it's changed?
In addition, it'd be nice to also provide a suggestion fixer that uses some arbitrary names for the suggestion group. Maybe:
temp1
,temp2
, etc.?Participation
Additional comments
Named capture groups are pretty new and many developers (myself included!) don't know the syntax on demand. Even if they do, it's just nice to have a suggestion when there's a non-trivial complaint to fix.
The text was updated successfully, but these errors were encountered: