Enable lints (#11891)
* enable lint prefer_final_fields * enable lint recursive_getters * enable lint unnecessary_overrides
This commit is contained in:
parent
9b5599a4a7
commit
0783ec906b
@ -117,7 +117,7 @@ linter:
|
||||
# - prefer_constructors_over_static_methods # not yet tested
|
||||
- prefer_contains
|
||||
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
|
||||
# - prefer_final_fields # https://github.com/dart-lang/linter/issues/506
|
||||
- prefer_final_fields
|
||||
- prefer_final_locals
|
||||
# - prefer_foreach # not yet tested
|
||||
# - prefer_function_declarations_over_variables # not yet tested
|
||||
@ -127,7 +127,7 @@ linter:
|
||||
- prefer_is_not_empty
|
||||
# - prefer_single_quote_strings # not yet tested
|
||||
# - public_member_api_docs # this is the only difference from analysis_options_repo.yaml
|
||||
# - recursive_getters # https://github.com/dart-lang/linter/issues/452
|
||||
- recursive_getters
|
||||
- slash_for_doc_comments
|
||||
- sort_constructors_first
|
||||
- sort_unnamed_constructors_first
|
||||
@ -140,7 +140,7 @@ linter:
|
||||
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
|
||||
- unnecessary_null_aware_assignments
|
||||
- unnecessary_null_in_if_null_operators
|
||||
# - unnecessary_overrides # https://github.com/dart-lang/linter/issues/626 and https://github.com/dart-lang/linter/issues/627
|
||||
- unnecessary_overrides
|
||||
- unnecessary_this
|
||||
- use_rethrow_when_possible
|
||||
# - use_setters_to_change_properties # not yet tested
|
||||
|
@ -111,7 +111,7 @@ linter:
|
||||
# - prefer_constructors_over_static_methods # not yet tested
|
||||
- prefer_contains
|
||||
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
|
||||
# - prefer_final_fields # https://github.com/dart-lang/linter/issues/506
|
||||
- prefer_final_fields
|
||||
- prefer_final_locals
|
||||
# - prefer_foreach # not yet tested
|
||||
# - prefer_function_declarations_over_variables # not yet tested
|
||||
@ -121,7 +121,7 @@ linter:
|
||||
- prefer_is_not_empty
|
||||
# - prefer_single_quote_strings # not yet tested
|
||||
- public_member_api_docs # this is the only difference from analysis_options_repo.yaml
|
||||
# - recursive_getters # https://github.com/dart-lang/linter/issues/452
|
||||
- recursive_getters
|
||||
- slash_for_doc_comments
|
||||
- sort_constructors_first
|
||||
- sort_unnamed_constructors_first
|
||||
@ -134,7 +134,7 @@ linter:
|
||||
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
|
||||
- unnecessary_null_aware_assignments
|
||||
- unnecessary_null_in_if_null_operators
|
||||
# - unnecessary_overrides # https://github.com/dart-lang/linter/issues/626 and https://github.com/dart-lang/linter/issues/627
|
||||
- unnecessary_overrides
|
||||
- unnecessary_this
|
||||
- use_rethrow_when_possible
|
||||
# - use_setters_to_change_properties # not yet tested
|
||||
|
@ -32,7 +32,7 @@ class MyHomePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
TextEditingController _controller = new TextEditingController();
|
||||
final TextEditingController _controller = new TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -352,7 +352,7 @@ class SemanticsNode extends AbstractNode {
|
||||
}
|
||||
}
|
||||
|
||||
Set<SemanticsTag> _tags = new Set<SemanticsTag>();
|
||||
final Set<SemanticsTag> _tags = new Set<SemanticsTag>();
|
||||
|
||||
/// Tags the [SemanticsNode] with [tag].
|
||||
///
|
||||
|
@ -132,7 +132,7 @@ class FuchsiaReloadCommand extends FlutterCommand {
|
||||
}
|
||||
|
||||
// A cache of VMService connections.
|
||||
HashMap<int, VMService> _vmServiceCache = new HashMap<int, VMService>();
|
||||
final HashMap<int, VMService> _vmServiceCache = new HashMap<int, VMService>();
|
||||
|
||||
VMService _getVMService(int port) {
|
||||
if (!_vmServiceCache.containsKey(port)) {
|
||||
|
@ -30,9 +30,9 @@ class MockApplicationPackageStore extends ApplicationPackageStore {
|
||||
}
|
||||
|
||||
class MockPollingDeviceDiscovery extends PollingDeviceDiscovery {
|
||||
List<Device> _devices = <Device>[];
|
||||
StreamController<Device> _onAddedController = new StreamController<Device>.broadcast();
|
||||
StreamController<Device> _onRemovedController = new StreamController<Device>.broadcast();
|
||||
final List<Device> _devices = <Device>[];
|
||||
final StreamController<Device> _onAddedController = new StreamController<Device>.broadcast();
|
||||
final StreamController<Device> _onRemovedController = new StreamController<Device>.broadcast();
|
||||
|
||||
MockPollingDeviceDiscovery() : super('mock');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user