Skip to main content

binary-expression-operand-order

added in: 1.6.0
🛠
Free+

Warns when a literal value is on the left-hand side in binary expressions.

❌ Bad:

final a = 1 + b;

✅ Good:

final a = b + 1;