Not offering a PR here, but just thought such a rule could possibly fit your project...
Namely, preferring String.prototype.matchAll
to while
loop exec
assignments.
As per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll#Examples , one can replace this:
let match;
while ((match = regexp.exec(str)) !== null) {
}
..with the likes of:
for (const match of str.matchAll(regexp)) {
}
I find it quite a bit more elegant and semantic, and it allows avoiding defining a variable in the parent block.
If not, no worries, just thought I'd see if it might pique the interest of others.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too