Unverified Commit 4adad2c6 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

update list of lints (#47661)

parent fcaf9c40
...@@ -59,6 +59,7 @@ linter: ...@@ -59,6 +59,7 @@ linter:
- avoid_classes_with_only_static_members - avoid_classes_with_only_static_members
# - avoid_double_and_int_checks # only useful when targeting JS runtime # - avoid_double_and_int_checks # only useful when targeting JS runtime
- avoid_empty_else - avoid_empty_else
# - avoid_equals_and_hash_code_on_mutable_classes # not yet tested
- avoid_field_initializers_in_const_classes - avoid_field_initializers_in_const_classes
- avoid_function_literals_in_foreach_calls - avoid_function_literals_in_foreach_calls
# - avoid_implementing_value_types # not yet tested # - avoid_implementing_value_types # not yet tested
...@@ -66,6 +67,7 @@ linter: ...@@ -66,6 +67,7 @@ linter:
# - avoid_js_rounded_ints # only useful when targeting JS runtime # - avoid_js_rounded_ints # only useful when targeting JS runtime
- avoid_null_checks_in_equality_operators - avoid_null_checks_in_equality_operators
# - avoid_positional_boolean_parameters # not yet tested # - avoid_positional_boolean_parameters # not yet tested
# - avoid_print # not yet tested
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356) # - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
- avoid_relative_lib_imports - avoid_relative_lib_imports
- avoid_renaming_method_parameters - avoid_renaming_method_parameters
...@@ -80,9 +82,12 @@ linter: ...@@ -80,9 +82,12 @@ linter:
- avoid_slow_async_io - avoid_slow_async_io
- avoid_types_as_parameter_names - avoid_types_as_parameter_names
# - avoid_types_on_closure_parameters # conflicts with always_specify_types # - avoid_types_on_closure_parameters # conflicts with always_specify_types
# - avoid_unnecessary_containers # not yet tested
- avoid_unused_constructor_parameters - avoid_unused_constructor_parameters
- avoid_void_async - avoid_void_async
# - avoid_web_libraries_in_flutter # not yet tested
- await_only_futures - await_only_futures
- camel_case_extensions
- camel_case_types - camel_case_types
- cancel_subscriptions - cancel_subscriptions
# - cascade_invocations # not yet tested # - cascade_invocations # not yet tested
...@@ -110,6 +115,7 @@ linter: ...@@ -110,6 +115,7 @@ linter:
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181 # - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
- no_adjacent_strings_in_list - no_adjacent_strings_in_list
- no_duplicate_case_values - no_duplicate_case_values
# - no_logic_in_create_state # not yet tested
- non_constant_identifier_names - non_constant_identifier_names
# - null_closures # not yet tested # - null_closures # not yet tested
# - omit_local_variable_types # opposite of always_specify_types # - omit_local_variable_types # opposite of always_specify_types
...@@ -149,9 +155,11 @@ linter: ...@@ -149,9 +155,11 @@ linter:
# - prefer_interpolation_to_compose_strings # not yet tested # - prefer_interpolation_to_compose_strings # not yet tested
- prefer_is_empty - prefer_is_empty
- prefer_is_not_empty - prefer_is_not_empty
- prefer_is_not_operator
- prefer_iterable_whereType - prefer_iterable_whereType
# - prefer_mixin # https://github.com/dart-lang/language/issues/32 # - prefer_mixin # https://github.com/dart-lang/language/issues/32
# - prefer_null_aware_operators # disable until NNBD, see https://github.com/flutter/flutter/pull/32711#issuecomment-492930932 # - prefer_null_aware_operators # disable until NNBD, see https://github.com/flutter/flutter/pull/32711#issuecomment-492930932
# - prefer_relative_imports # not yet tested
- prefer_single_quotes - prefer_single_quotes
- prefer_spread_collections - prefer_spread_collections
- prefer_typing_uninitialized_variables - prefer_typing_uninitialized_variables
...@@ -172,6 +180,7 @@ linter: ...@@ -172,6 +180,7 @@ linter:
# - unnecessary_await_in_return # not yet tested # - unnecessary_await_in_return # not yet tested
- unnecessary_brace_in_string_interps - unnecessary_brace_in_string_interps
- unnecessary_const - unnecessary_const
# - unnecessary_final # conflicts with prefer_final_locals
- unnecessary_getters_setters - unnecessary_getters_setters
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498 # - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
- unnecessary_new - unnecessary_new
......
...@@ -216,7 +216,7 @@ class ForcePressGestureRecognizer extends OneSequenceGestureRecognizer { ...@@ -216,7 +216,7 @@ class ForcePressGestureRecognizer extends OneSequenceGestureRecognizer {
// If the device has a maximum pressure of less than or equal to 1, it // If the device has a maximum pressure of less than or equal to 1, it
// doesn't have touch pressure sensing capabilities. Do not participate // doesn't have touch pressure sensing capabilities. Do not participate
// in the gesture arena. // in the gesture arena.
if (!(event is PointerUpEvent) && event.pressureMax <= 1.0) { if (event is! PointerUpEvent && event.pressureMax <= 1.0) {
resolve(GestureDisposition.rejected); resolve(GestureDisposition.rejected);
} else { } else {
startTrackingPointer(event.pointer, event.transform); startTrackingPointer(event.pointer, event.transform);
......
...@@ -687,8 +687,7 @@ class _MotionEventsDispatcher { ...@@ -687,8 +687,7 @@ class _MotionEventsDispatcher {
return AndroidPointerProperties(id: pointerId, toolType: toolType); return AndroidPointerProperties(id: pointerId, toolType: toolType);
} }
bool isSinglePointerAction(PointerEvent event) => bool isSinglePointerAction(PointerEvent event) => event is! PointerDownEvent && event is! PointerUpEvent;
!(event is PointerDownEvent) && !(event is PointerUpEvent);
} }
/// A render object for embedding a platform view. /// A render object for embedding a platform view.
......
...@@ -148,7 +148,7 @@ void main() { ...@@ -148,7 +148,7 @@ void main() {
), ),
); );
ContainerLayer layer = RendererBinding.instance.renderView.debugLayer; ContainerLayer layer = RendererBinding.instance.renderView.debugLayer;
while (layer != null && !(layer is OpacityLayer)) while (layer != null && layer is! OpacityLayer)
layer = layer.firstChild as ContainerLayer; layer = layer.firstChild as ContainerLayer;
expect(layer, isInstanceOf<OpacityLayer>()); expect(layer, isInstanceOf<OpacityLayer>());
final OpacityLayer opacityLayer = layer as OpacityLayer; final OpacityLayer opacityLayer = layer as OpacityLayer;
......
...@@ -223,7 +223,7 @@ class AndroidApk extends ApplicationPackage { ...@@ -223,7 +223,7 @@ class AndroidApk extends ApplicationPackage {
String actionName = ''; String actionName = '';
String categoryName = ''; String categoryName = '';
for (xml.XmlNode node in element.children) { for (xml.XmlNode node in element.children) {
if (!(node is xml.XmlElement)) { if (node is! xml.XmlElement) {
continue; continue;
} }
final xml.XmlElement xmlElement = node as xml.XmlElement; final xml.XmlElement xmlElement = node as xml.XmlElement;
......
...@@ -201,7 +201,7 @@ class Plugin { ...@@ -201,7 +201,7 @@ class Plugin {
static List<String> _validateMultiPlatformYaml(YamlMap yaml) { static List<String> _validateMultiPlatformYaml(YamlMap yaml) {
bool isInvalid(String key, bool Function(YamlMap) validate) { bool isInvalid(String key, bool Function(YamlMap) validate) {
final dynamic value = yaml[key]; final dynamic value = yaml[key];
if (!(value is YamlMap)) { if (value is! YamlMap) {
return false; return false;
} }
final YamlMap yamlValue = value as YamlMap; final YamlMap yamlValue = value as YamlMap;
......
...@@ -158,7 +158,7 @@ class _BufferedStreamController<T> { ...@@ -158,7 +158,7 @@ class _BufferedStreamController<T> {
StreamController<T> get _streamController { StreamController<T> get _streamController {
_streamControllerInstance ??= StreamController<T>.broadcast(onListen: () { _streamControllerInstance ??= StreamController<T>.broadcast(onListen: () {
for (dynamic event in _events) { for (dynamic event in _events) {
assert(!(T is List)); assert(T is! List);
if (event is T) { if (event is T) {
_streamControllerInstance.add(event); _streamControllerInstance.add(event);
} else { } else {
......
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