require-blank-line-before-comment
WarningWarningWarningWarningLeave a blank line before a comment inside a body, unless it is the first line of the block or continues another comment.
fn run() { let user = load(); // Only send email if not in noop mode send(user);}fn run() { // Load the user before anything else let user = load(); // Only send email if not in noop mode send(user);}fn run() { let user = load(); // The first comment explains the group // and this one continues it send(user);}/// Documentation stays attached to the itemfn run() {}function run() { const user = load(); // Keep the newest page save(user);}function run() { // Load the user first const user = load(); // Keep the newest page save(user);}void run() { final count = children.length; // If there's only one item layout(count);}void run() { final count = children.length; // If there's only one item layout(count);}void run() { final router = load(); // Scroll to top using the current [PrimaryScrollController] // Reads without triggering rebuilds router.scrollToTop();}void main() async { await Hive.initFlutter(); // Commented block ending with a semicolon; // runApp(const Application()); start();}class A { void run() { int count = load(); // Store the count save(count); }}class A { void run() { int count = load(); // Store the count save(count); }}How to fix
A comment inside a body starts a new group. You can skip the blank line if the comment is on the first line of the block or directly below another comment.
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 comment inside a body starts a new group. You can skip the blank line if the comment is on the first line of the block or directly below another comment.
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 comment inside a body starts a new group. You can skip the blank line if the comment is on the first line of the block or directly below another comment.
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 comment inside a body starts a new group. You can skip the blank line if the comment is on the first line of the block or directly below another comment.
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.