Skip to content

add information about non-capturing regex groups in prefer-named-capture-group docs #15007

@akwodkiewicz

Description

@akwodkiewicz

I wanted to point out that the prefer-named-capture-group rule suggest that 2 actions that can be made to fix the error:

  • either convert the group to a non-capturing group
  • or use a named group

rule

However, the current version of documentation only explains how to use the named groups.

While I understand that the rule tries to enforce named groups, it would be wise to instruct about the usage of non-capturing groups (?:). Somebody already must have noticed that case when they created the error message, so why not explaining the second approach further in the docs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussiondocumentationRelates to ESLint's documentationruleRelates to ESLint's core rules

    Type

    No type

    Projects

    Status

    Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions