eslint-plugin-no-return-in-loop
This plugin reports an error when there is an empty return in a loop:
Not okay:
for (const n of [1, 2, 3]) {
 if (n === 2) return; /* this was surely meant to be `break` or `continue`
}Okay:
for (const n of [1, 2, 3]) {
 if (n === 2) return true;
}Install:
npm install @kapouer/eslint-plugin-no-return-in-loopConfigure:
"plugins": [
 "@babel",
 "@kapouer/no-return-in-loop"
],
"rules": {
 "@kapouer/no-return-in-loop/no-return-in-loop": "error"
}