Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive of regexp/no-unused-capturing-group with hasIndices #675

Closed
sapphi-red opened this issue Dec 3, 2023 · 1 comment · Fixed by #676
Closed

False positive of regexp/no-unused-capturing-group with hasIndices #675

sapphi-red opened this issue Dec 3, 2023 · 1 comment · Fixed by #676
Labels
bug Something isn't working

Comments

@sapphi-red
Copy link

Information:

  • ESLint version: 8.54.0
  • eslint-plugin-regexp version: 2.1.1

Description

const re = /(foo)/d

console.log(re.exec('foo').indices[1])

https://ota-meshi.github.io/eslint-plugin-regexp/playground/#eJwVyUEKwyAQQNGryGyiUJV2KfQktYugUxFkRsYIgZC7N1l9eP+AxBkhXKGxKUH1Vl7/mI3PkSLdzA1d46IFHe6Y9HLtxbhKuSYcn+fXRIIHyGw4IBwgWHDvnthOmgOzTWvfplQqtgjPDuF1nn+8YyoG

In this case, the capture group is used by .indices[1]. But the rule reports the error.

@ota-meshi ota-meshi added the bug Something isn't working label Dec 3, 2023
@ota-meshi
Copy link
Owner

Thank you for posting this issue.
I'll fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants