Rules
General rules configuration is described here.
Rules are grouped by category to help you understand their purpose. Each rule has emojis denoting:
- ✅ - this rule is included into the "recommended" preset
- ⚙️ - this rule is configurable
- 🛠 - some problems reported by this rule can be fixed by editor suggestions or by CLI fixes
You can also suggest a rule!
Common 279 rules
Ensures that the order of named arguments in function, method, and constructor invocations matches the corresponding order of named parameters
Warns when a collection is accessed by a constant index inside a for loop
Warns when a record type declaration contains fields with void
, Never
or Null
Warns when a cascade expression is used after if null (??) binary expression without parentheses
Warns when a collection is checked for equality with another collection
Warns when a collection method is used with an expression of an unrelated type
Warns then a binary expression has a boolean constant that either makes the resulting value always the same or does not affect it
Warns when a class or enum declaration has several constants with the same primitive values
Warns when a final variable has the same initializer as another variable in scope
Warns when a class has a mixin that is already present in that class's hierarchy.
Warns when a file has duplicate imports which differ only in name prefix
Warns when a LogicalOrPattern
or LogicalAndPattern
contains duplicate patterns
Warns when a test case has multiple test assertions with the same expression and expected value
Warns when the dynamic
type is used as a variable type in a declaration, a function return type, etc.
Warns when a variable is declared with an explicit type that can be omitted