Skip to main content

newline-before-method

added in: 1.21.0
🛠
Pro+

Enforces a blank line before a method declaration.

Example

❌ Bad:

class Wrong {
void fn() {}
void another() {} // LINT: Missing a blank line before this method declaration. Try adding it.
void anotherFn() {} // LINT: Missing a blank line before this method declaration. Try adding it.
}

✅ Good:

class Correct {
void fn() {}

void another() {}

void anotherFn() {}
}