目錄
目錄

Avoid empty else statements.

This rule is available as of Dart 2.0.0.

Rule sets: core, recommended, flutter

This rule has a quick fix available.

Details

AVOID empty else statements.

BAD:

if (x > y)
  print("1");
else ;
  print("2");

Usage

To enable the avoid_empty_else rule, add avoid_empty_else under linter > rules in your analysis_options.yaml file:

linter:
  rules:
    - avoid_empty_else