require-blank-line-after-guard
WarningWarningLeave a blank line after a one-line guard such as if (index < 0) return;.
void run(int index) { if (index < 0) return; save(index);}void run(Response response) { if (response.parsedData == null) throw Exception("Failed to sign in"); final user = response.parsedData!.signIn;}void run(int index) { final value = load(); if (index < 0) return; save(value);}class A { void run(int index) { if (index < 0) return; save(index); }}class A { void run(int index) { if (index < 0) return; save(index); }}How to fix
A one-line guard such as if (index < 0) return; ends a group of statements.
The check reads the enclosing block's text because the syntax tree omits blank lines. If the block has several violations of this rule, the report can land on a neighboring node.
How to fix
A one-line guard such as if (index < 0) return; ends a group of statements.
The check reads the enclosing block's text because the syntax tree omits blank lines. If the block has several violations of this rule, the report can land on a neighboring node.