Why this matters
Using explicit type annotations improves readability and prevents ambiguity, especially when the type is not obvious from the assignment.
Check that fields and top-level variables are type-annotated explicitly when the type is not obvious from the context. This avoids ambiguity.
Using explicit type annotations improves readability and prevents ambiguity, especially when the type is not obvious from the assignment.
Side-by-side examples engineers can pattern-match during review.
install(id, destination) => ...Future<bool> install(PackageId id, String destination) => ...install(id, destination) => ...Future<bool> install(PackageId id, String destination) => ...From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.