From d114a12846177d82839b167a9fe190cea8760e2d Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Mon, 30 Dec 2024 17:48:10 +0100 Subject: [PATCH] fix beta lints --- .../example/analysis_options.yaml | 97 ------------------- .../sqflite_common_ffi_web/example/ui.dart | 3 +- 2 files changed, 2 insertions(+), 98 deletions(-) delete mode 100644 packages_web/sqflite_common_ffi_web/example/analysis_options.yaml diff --git a/packages_web/sqflite_common_ffi_web/example/analysis_options.yaml b/packages_web/sqflite_common_ffi_web/example/analysis_options.yaml deleted file mode 100644 index 15899f8b..00000000 --- a/packages_web/sqflite_common_ffi_web/example/analysis_options.yaml +++ /dev/null @@ -1,97 +0,0 @@ -include: package:lints/recommended.yaml - -# Until there are meta linter rules, each desired lint must be explicitly enabled. -# See: https://github.com/dart-lang/linter/issues/288 -# -# For a list of lints, see: http://dart-lang.github.io/linter/lints/ -# See the configuration guide for more -# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer -# -# NOTE: Please keep this file in sync with -# https://github.com/flutter/flutter/blob/master/analysis_options.yaml - -analyzer: - language: - strict-casts: true - strict-inference: true - - errors: - # treat missing required parameters as a warning (not a hint) - missing_required_param: warning - # allow having TODOs in the code - todo: ignore - # Ignore errors like - # 'super_goes_last' is a deprecated lint rule and should not be used • included_file_warning - included_file_warning: ignore - -linter: - rules: - - always_declare_return_types - - avoid_dynamic_calls - - avoid_empty_else - - avoid_relative_lib_imports - - avoid_shadowing_type_parameters - - avoid_slow_async_io - - avoid_types_as_parameter_names - - await_only_futures - - camel_case_extensions - - camel_case_types - - cancel_subscriptions - - curly_braces_in_flow_control_structures - # - depend_on_referenced_packages - - directives_ordering - - empty_catches - - hash_and_equals - - collection_methods_unrelated_type - - no_adjacent_strings_in_list - - no_duplicate_case_values - - non_constant_identifier_names - - omit_local_variable_types - - package_api_docs - - package_prefixed_library_names - - prefer_generic_function_type_aliases - - prefer_is_empty - - prefer_is_not_empty - - prefer_iterable_whereType - - prefer_single_quotes - - prefer_typing_uninitialized_variables - - sort_child_properties_last - - test_types_in_equals - - throw_in_finally - - unawaited_futures - - unnecessary_null_aware_assignments - - unnecessary_statements - - unrelated_type_equality_checks - - unsafe_html - - use_full_hex_values_for_flutter_colors - - valid_regexps - - - constant_identifier_names - - control_flow_in_finally - - empty_statements - - implementation_imports - - overridden_fields - - package_names - - prefer_const_constructors - - prefer_initializing_formals - - prefer_void_to_null - # - - annotate_overrides - - avoid_init_to_null - - avoid_null_checks_in_equality_operators - - avoid_return_types_on_setters - - empty_constructor_bodies - - library_names - - library_prefixes - - prefer_adjacent_string_concatenation - - prefer_collection_literals - - prefer_contains - - slash_for_doc_comments - - type_init_formals - - unnecessary_const - - unnecessary_new - - unnecessary_null_in_if_null_operators - - use_rethrow_when_possible - - # === doc rules === - - public_member_api_docs diff --git a/packages_web/sqflite_common_ffi_web/example/ui.dart b/packages_web/sqflite_common_ffi_web/example/ui.dart index 81c5f517..430f5177 100644 --- a/packages_web/sqflite_common_ffi_web/example/ui.dart +++ b/packages_web/sqflite_common_ffi_web/example/ui.dart @@ -6,6 +6,7 @@ var countLineMax = 100; var _output = web.document.querySelector('#output')!; var _input = web.document.querySelector('#input')!; void write(String message) { + // ignore: avoid_print print(message); lines.add(message); if (lines.length > countLineMax + 10) { @@ -15,7 +16,7 @@ void write(String message) { } void addButton(String text, FutureOr Function() action) { - _input.append((web.document.createElement('button') as web.HTMLButtonElement) + _input.append(web.HTMLButtonElement() ..innerText = text ..onClick.listen((event) async { await action();