empty_statements

Group: errors

Maturity: stable

Dart SDK: >= 2.0.0 • (Linter v0.1.21)

Since info is static, may be stale
flutter

View all Lint Rules

Using the Linter

AVOID empty statements.

Empty statements almost always indicate a bug.

For example,

BAD:

if (complicated.expression.foo());
  bar();

Formatted with dartfmt the bug becomes obvious:

if (complicated.expression.foo()) ;
bar();

Better to avoid the empty statement altogether.

GOOD:

if (complicated.expression.foo())
  bar();