Disallow continue
statements
The continue statement terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration. When used incorrectly it makes code less testable, less readable and less maintainable. Structured control flow statements such as if should be used instead.
var sum = 0,
i;
for (i = 0; i < 10; i++) {
if (i >= 5) {
continue;
}
sum += i;
}
To enable this rule in the CLI or using the config file, you can use:
::: code-group
oxlint --deny no-continue
{
"rules": {
"no-continue": "error"
}
}
:::