-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Closed
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressiondependency: dartDart team may need to help usDart team may need to help usframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
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_functionsfromcore.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_typeslint (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 createto generate ananalysis_options.yamlfile 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.yamlwith a message (duringflutter analyze) to upgrade to a customanalysis_options.yamlfile 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_futureslint 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
NavigatorandAnimationControllermethods, maybe others)
-
prefer_mixinslint 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
ChangeNotifierandWidgetsBindingObserver, 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.
mit-mit, pq and PiN73
Metadata
Metadata
Assignees
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressiondependency: dartDart team may need to help usDart team may need to help usframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.