Commit 0783ec90 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

Enable lints (#11891)

* enable lint prefer_final_fields

* enable lint recursive_getters

* enable lint unnecessary_overrides
parent 9b5599a4
...@@ -117,7 +117,7 @@ linter: ...@@ -117,7 +117,7 @@ linter:
# - prefer_constructors_over_static_methods # not yet tested # - prefer_constructors_over_static_methods # not yet tested
- prefer_contains - 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_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_final_locals
# - prefer_foreach # not yet tested # - prefer_foreach # not yet tested
# - prefer_function_declarations_over_variables # not yet tested # - prefer_function_declarations_over_variables # not yet tested
...@@ -127,7 +127,7 @@ linter: ...@@ -127,7 +127,7 @@ linter:
- prefer_is_not_empty - prefer_is_not_empty
# - prefer_single_quote_strings # not yet tested # - prefer_single_quote_strings # not yet tested
# - public_member_api_docs # this is the only difference from analysis_options_repo.yaml # - 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 - slash_for_doc_comments
- sort_constructors_first - sort_constructors_first
- sort_unnamed_constructors_first - sort_unnamed_constructors_first
...@@ -140,7 +140,7 @@ linter: ...@@ -140,7 +140,7 @@ linter:
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498 # - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
- unnecessary_null_aware_assignments - unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators - 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 - unnecessary_this
- use_rethrow_when_possible - use_rethrow_when_possible
# - use_setters_to_change_properties # not yet tested # - use_setters_to_change_properties # not yet tested
......
...@@ -111,7 +111,7 @@ linter: ...@@ -111,7 +111,7 @@ linter:
# - prefer_constructors_over_static_methods # not yet tested # - prefer_constructors_over_static_methods # not yet tested
- prefer_contains - 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_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_final_locals
# - prefer_foreach # not yet tested # - prefer_foreach # not yet tested
# - prefer_function_declarations_over_variables # not yet tested # - prefer_function_declarations_over_variables # not yet tested
...@@ -121,7 +121,7 @@ linter: ...@@ -121,7 +121,7 @@ linter:
- prefer_is_not_empty - prefer_is_not_empty
# - prefer_single_quote_strings # not yet tested # - prefer_single_quote_strings # not yet tested
- public_member_api_docs # this is the only difference from analysis_options_repo.yaml - 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 - slash_for_doc_comments
- sort_constructors_first - sort_constructors_first
- sort_unnamed_constructors_first - sort_unnamed_constructors_first
...@@ -134,7 +134,7 @@ linter: ...@@ -134,7 +134,7 @@ linter:
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498 # - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
- unnecessary_null_aware_assignments - unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators - 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 - unnecessary_this
- use_rethrow_when_possible - use_rethrow_when_possible
# - use_setters_to_change_properties # not yet tested # - use_setters_to_change_properties # not yet tested
......
...@@ -32,7 +32,7 @@ class MyHomePage extends StatefulWidget { ...@@ -32,7 +32,7 @@ class MyHomePage extends StatefulWidget {
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
TextEditingController _controller = new TextEditingController(); final TextEditingController _controller = new TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
...@@ -352,7 +352,7 @@ class SemanticsNode extends AbstractNode { ...@@ -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]. /// Tags the [SemanticsNode] with [tag].
/// ///
......
...@@ -132,7 +132,7 @@ class FuchsiaReloadCommand extends FlutterCommand { ...@@ -132,7 +132,7 @@ class FuchsiaReloadCommand extends FlutterCommand {
} }
// A cache of VMService connections. // 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) { VMService _getVMService(int port) {
if (!_vmServiceCache.containsKey(port)) { if (!_vmServiceCache.containsKey(port)) {
......
...@@ -30,9 +30,9 @@ class MockApplicationPackageStore extends ApplicationPackageStore { ...@@ -30,9 +30,9 @@ class MockApplicationPackageStore extends ApplicationPackageStore {
} }
class MockPollingDeviceDiscovery extends PollingDeviceDiscovery { class MockPollingDeviceDiscovery extends PollingDeviceDiscovery {
List<Device> _devices = <Device>[]; final List<Device> _devices = <Device>[];
StreamController<Device> _onAddedController = new StreamController<Device>.broadcast(); final StreamController<Device> _onAddedController = new StreamController<Device>.broadcast();
StreamController<Device> _onRemovedController = new StreamController<Device>.broadcast(); final StreamController<Device> _onRemovedController = new StreamController<Device>.broadcast();
MockPollingDeviceDiscovery() : super('mock'); MockPollingDeviceDiscovery() : super('mock');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment