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
no-invalid-regexp rule doesn't error with example from its documentation #10861
Comments
It was still working with eslint 4.15.0. Could it be a regression introduced in #10062? |
Following up on this, can this be reproduced by an eslint member to be a confirmed bug? If so, Ill work on this. |
Thanks for the report, I can reproduce this issue. |
Thanks @not-an-aardvark ill work on this. Might have some questions. |
Is this really a bug in the rule? I'm reading the example as a regex which matches against a backslash anywhere in the string. My understanding is that escaping the backslash would be required in both the new RegExp("\\");
/\\/; If I'm misunderstanding something, I would be grateful to learn what that is. Otherwise, I think this should be a documentation change (to remove the example), not a bugfix. |
When I run that code, I get an error:
|
Nevermind, I misread it. |
@mysticatea im not understanding, how is it a valid pattern when |
I'm sorry, I misread it as |
|
So this is a bug in regexpp; it hasn't followed the tc39/ecma262#910 spec update yet because I had overlooked it. I will update it. |
@mysticatea I was going to ask if this was a regexpp issue! Thanks for the PR, so when this gets merged in we will need to update the regexpp package and then I was thinking that we should add a test to the test suite to avoid regressions for this use case? Is this correct? |
Thanks for fixing this! |
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.
What did you expect to happen?
eslint failing with an error from the
no-invalid-regexp
rule.What actually happened? Please include the actual, raw output from ESLint.
eslint passed with no output.
The text was updated successfully, but these errors were encountered: