Skip to main content

newline-before-throw

effort: 2m
has IDE fix
has auto-fix
pro+

Enforces a blank line before a throw expression in a block.

Example

❌ Bad:

void fn() {
if (...) {
...
throw Exception(); // LINT: Missing a blank line before 'throw'.
}
}

✅ Good:

void fn() {
if (...) {
...

throw Exception();
}

throw Exception();
}