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

no-invalid-regexp: duplicate group names are valid when defined over a union #1372

Open
mfulton26 opened this issue Dec 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mfulton26
Copy link

Lint Name

Code Snippet

/(?<op>do)\(\)|(?<op>don't)\(\)|(?<op>mul)\((?<a>\d+),(?<b>\d+)\)/g;

Expected Result

No lint warning.

Actual Result

Invalid RegExp literal
Rework regular expression to be a valid

Additional Info

MDN also calls this out as valid in their valid cases:

/(?<firstName>\w+) (?<lastName>\w+)/;
/(?<year>\d{4})-\d{2}|\d{2}-(?<year>\d{4})/;

Version

deno 2.1.2 (stable, release, aarch64-apple-darwin)
v8 13.0.245.12-rusty
typescript 5.6.2

@mfulton26 mfulton26 added the bug Something isn't working label Dec 3, 2024
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
Development

No branches or pull requests

1 participant