7b71ed17b2
This CL implements a new lint, `unsafe_variance`. This lint emits a warning whenever an instance member declaration has a signature where a type variable declared by the enclosing class/mixin/enum occurs in a non-covariant position in the return type (including the type of an instance variable). Issues: https://github.com/dart-lang/linter/issues/4111, with goals related to https://github.com/dart-lang/language/issues/296 and https://github.com/dart-lang/language/issues/524. Change-Id: I1352d71d61fece03a432ccf0d98825a69e3a457f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384700 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Erik Ernst <eernst@google.com>
Examples
Some example analysis options files.
- all.yaml - auto-generated options enabling all lints.
For more on lint rule sets see the analyzer docs on customizing static analysis.
Official Dart lint rules are maintained in
package:lints.
Flutter team rules are maintained in
package:flutter_lints.