Closed
Description
The lints currently applied by flutter analyze
to flutter applications created with flutter create
is outdated: analysis_options_user.yaml
received its last meaningful update in October 2019. This umbrella issue tracks the work necessary to update those lints and align the set of lints recommended for Flutter application with the Dart universe.
Details of the approach are discussed in http://flutter.dev/go/flutter-lints.
Work Items
- Remove avoid_private_typedef_functions from recommend.yaml dart-archive/linter#2517, Remove
avoid_private_typedef_functions
fromcore.yaml
- Lints to be considered for score.yaml or recommend.yaml from Flutter dart-lang/sdk#58349, Add Flutter-specific lints to core.yaml/recommend.yaml or new Flutter-specific lint set on top of recommend.yaml (WIP: Add lints for Flutter apps and packages dart-archive/lints#9)
- Reach an agreement on how to handle the
omit_local_variable_types
lint (Update: Removed fromrecommend.yaml
) - identify place to host canonical lints dart-lang/sdk#58302, publish a 1.0.0 version dart-lang/core#842,
core.yaml
,recommend.yaml
, and potentially a Flutter-specific lint file are published in a package - Change
flutter create
to generate ananalysis_options.yaml
file importing the new recommended set of lints from that package (RFC: Integrate package:flutter_lints into templates #81417) - Publish migration guide to upgrade existing apps to the new lints (Done: Migration guide for package:flutter_lints website#5749_)
- Deprecate analysis_options_user.yaml #82948 Deprecate
analysis_options_user.yaml
with a message (duringflutter analyze
) to upgrade to a customanalysis_options.yaml
file importing the new recommended set of lints - Use pkg:lints and pkg:flutter_lints when analyzing code dart-lang/dart-pad#1881, Update DartPad to use the new lint sets
Punted
We've decided to remove unawaited_futures
and prefer_mixins
from the lint set for now so the following issues are no longer blocking and can be addressed later.
-
unawaited_futures
lint is ready for Flutter code:- method-side opt-out for unawaited_futures dart-lang/sdk#58348, Method-side opt-out for unawaited_futures
- Move unawaited to package:meta? dart-lang/sdk#58351, Move unawaited to package:meta
- Enable the lint in the flutter codebase for dogfooding (opting out some
Navigator
andAnimationController
methods, maybe others)
-
prefer_mixins
lint is ready for Flutter code:- opt-out for old-school mixin-like classes from prefer_mixin dart-lang/sdk#45343, opt-out for old-school mixin-like classes from prefer_mixin
- Opt-out
ChangeNotifier
andWidgetsBindingObserver
, enable lint in flutter codebase for dogfooding
/cc @pq @Hixie @mit-mit @munificent @devoncarew I think these are the work items that came out of our meeting the other day.