Skip to content

Bug: allowConstructorFlags option of no-invalid-regexp allows duplicate strings #18755

Open
@Tanujkanti4441

Description

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", "a"] }]*/

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

What did you expect to happen?

eslint will report duplicate flag passed to allowConstructorFlags.

What actually happened?

eslint doesn't report it

Link to Minimal Reproducible Example

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

Participation

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

Additional comments

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionbreakingThis change is backwards-incompatiblebugESLint is working incorrectlyrepro:yesIssues with a reproducible exampleruleRelates to ESLint's core rules

Type

No type

Projects

  • Status

    Blocked

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions