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
prefer-named-capture-group is reporting incorrect locations #12233
prefer-named-capture-group is reporting incorrect locations #12233
Comments
Marking this as accepted because this small bug is obvious. I'll fix this, just need help with what would be a better solution:
|
I prefer Solution 1. |
As I noted in the PR, I think I might (only slightly, not strongly) prefer solution 2. If we didn't specify the capture group content in the message, I would be strongly in favor of solution 1, but as it is, I think solution 2 would be a good experience for most users. |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
Demo link
What did you expect to happen?
2 errors, but not with incorrect locations.
What actually happened? Please include the actual, raw output from ESLint.
Are you willing to submit a pull request to fix this bug?
Yes.
Perhaps if
arguments[0]
is not a string literal whichraw
is same as internal presentation, then report the location of the wholearguments[0]
?The text was updated successfully, but these errors were encountered: