Skip to content

linter: new rule for detecting replaceAll with non-global regex #24340

Description

@DetachHead
> ''.replaceAll(/a/, '')
Uncaught TypeError: String.prototype.replaceAll called with a non-global RegExp argument
    at String.replaceAll (<anonymous>)

this looks like something that a linter should be able to detect easily, the fix being to add the g flag

Metadata

Metadata

Assignees

Labels

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions