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

Bug: no-invalid-regexp not reporting repeted flag allowed by allowConstructorFlags #18748

Closed
1 task done
Tanujkanti4441 opened this issue Aug 4, 2024 · 1 comment · Fixed by #18754
Closed
1 task done
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@Tanujkanti4441
Copy link
Contributor

Environment

Node version: latest
npm version: latest
Local ESLint version: latest
Global ESLint version: no
Operating System: windows

What parser are you using?

Default (Espree)

What did you do?

/*eslint no-invalid-regexp: ["error", { "allowConstructorFlags": ["a"] }]*/

new RegExp('.', 'aa');

What did you expect to happen?

report aa as invalid flag.

What actually happened?

rule doesn't report this as invalid supplied flag as it does with other predefined flags.

Link to Minimal Reproducible Example

https://eslint.org/play/#eyJ0ZXh0IjoiLyplc2xpbnQgbm8taW52YWxpZC1yZWdleHA6IFtcImVycm9yXCIsIHsgXCJhbGxvd0NvbnN0cnVjdG9yRmxhZ3NcIjogW1wiYVwiXSB9XSovXG5cbm5ldyBSZWdFeHAoJy4nLCAnYWEnKTsiLCJvcHRpb25zIjp7InJ1bGVzIjp7fSwibGFuZ3VhZ2VPcHRpb25zIjp7InNvdXJjZVR5cGUiOiJtb2R1bGUiLCJwYXJzZXJPcHRpb25zIjp7ImVjbWFGZWF0dXJlcyI6e319fX19

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@Tanujkanti4441 Tanujkanti4441 added bug ESLint is working incorrectly repro:needed This issue should include a reproducible example rule Relates to ESLint's core rules labels Aug 4, 2024
@aladdin-add
Copy link
Member

👍 confirmed, marking as accepted.

@aladdin-add aladdin-add added accepted There is consensus among the team that this change meets the criteria for inclusion and removed repro:needed This issue should include a reproducible example labels Aug 5, 2024
@Tanujkanti4441 Tanujkanti4441 self-assigned this Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

2 participants