Skip to content

feat: prefer-named-capture-group support v flag#17409

Merged
mdjermanovic merged 3 commits into
eslint:mainfrom
ota-meshi:prefer-named-capture-group
Jul 25, 2023
Merged

feat: prefer-named-capture-group support v flag#17409
mdjermanovic merged 3 commits into
eslint:mainfrom
ota-meshi:prefer-named-capture-group

Conversation

@ota-meshi

Copy link
Copy Markdown
Member

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[X] Changes an existing rule (template)

What changes did you make? (Give an overview)

Refs #17223

This PR modifies the prefer-named-capture-group rule and adds support for regexp v flag.

Is there anything you'd like reviewers to focus on?

@ota-meshi ota-meshi requested a review from a team as a code owner July 23, 2023 06:00
@eslint-github-bot eslint-github-bot Bot added the feature This change adds a new feature to ESLint label Jul 23, 2023
@netlify

netlify Bot commented Jul 23, 2023

Copy link
Copy Markdown

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 0f26760
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/64c05b4afc43a40008a52e8b

@mdjermanovic mdjermanovic mentioned this pull request Jul 23, 2023
19 tasks

@nzakas nzakas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Just left one suggestion to clarify a comment. Would like @mdjermanovic to review before merging.


// ES2024
"new RegExp('(?<c>[[A--B]])', 'v')",
String.raw`new RegExp('([\\q])', 'v')` // SyntaxError

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what you're saying here is that the regex intentionally has a syntax error? If so, can you expand the comment and explain why that's a useful valid test?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for reviewing this PR. I added a comment. Could you please check again?

@amareshsm amareshsm added accepted There is consensus among the team that this change meets the criteria for inclusion new syntax This issue is related to new syntax that has reached stage 4 contributor pool rule Relates to ESLint's core rules labels Jul 24, 2023
Comment thread lib/rules/prefer-named-capture-group.js Outdated

@nzakas nzakas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just waiting for @mdjermanovic to verify his comments.

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>

@mdjermanovic mdjermanovic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit 2a35f3e into eslint:main Jul 25, 2023
@ota-meshi ota-meshi deleted the prefer-named-capture-group branch July 26, 2023 00:38
@eslint-github-bot eslint-github-bot Bot locked and limited conversation to collaborators Jan 22, 2024
@eslint-github-bot eslint-github-bot Bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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 contributor pool feature This change adds a new feature to ESLint new syntax This issue is related to new syntax that has reached stage 4 rule Relates to ESLint's core rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants