diff --git a/packages/yumemi_lints/lib/dart/3.7/all.yaml b/packages/yumemi_lints/lib/dart/3.7/all.yaml new file mode 100644 index 0000000..161097c --- /dev/null +++ b/packages/yumemi_lints/lib/dart/3.7/all.yaml @@ -0,0 +1,222 @@ +# GENERATED CODE - DO NOT MODIFY BY HAND + +linter: + rules: + - always_declare_return_types # categories: style + - always_put_control_body_on_new_line # categories: errorProne,style + - always_put_required_named_parameters_first # categories: style + - always_specify_types # incompatibles: avoid_types_on_closure_parameters,omit_local_variable_types,omit_obvious_local_variable_types,omit_obvious_property_types # categories: style + - always_use_package_imports # incompatibles: prefer_relative_imports # categories: errorProne + - annotate_overrides # categories: style + - annotate_redeclares # categories: style + - avoid_annotating_with_dynamic # categories: brevity,style + - avoid_bool_literals_in_conditional_expressions # categories: brevity + - avoid_catches_without_on_clauses # categories: effectiveDart,style + - avoid_catching_errors # categories: style + - avoid_classes_with_only_static_members # categories: effectiveDart,languageFeatureUsage,style + - avoid_double_and_int_checks # categories: errorProne,web + - avoid_dynamic_calls # categories: binarySize,errorProne + - avoid_empty_else # categories: brevity,errorProne + - avoid_equals_and_hash_code_on_mutable_classes # categories: effectiveDart,style + - avoid_escaping_inner_quotes # categories: style + - avoid_field_initializers_in_const_classes # categories: style + - avoid_final_parameters # incompatibles: prefer_final_parameters # categories: style + - avoid_function_literals_in_foreach_calls # categories: style + - avoid_futureor_void # categories: errorProne,unintentional + - avoid_implementing_value_types # categories: style + - avoid_init_to_null # categories: brevity,effectiveDart,style + - avoid_js_rounded_ints # categories: errorProne,web + - avoid_multiple_declarations_per_line # categories: style + - avoid_null_checks_in_equality_operators # categories: style + - avoid_positional_boolean_parameters # categories: effectiveDart,style + - avoid_print # categories: unintentional + - avoid_private_typedef_functions # categories: style + - avoid_redundant_argument_values # categories: brevity,style + - avoid_relative_lib_imports # categories: errorProne + - avoid_renaming_method_parameters # categories: documentationCommentMaintenance + - avoid_return_types_on_setters # categories: brevity,style + - avoid_returning_null_for_void # categories: style + - avoid_returning_this # categories: effectiveDart,style + - avoid_setters_without_getters # categories: style + - avoid_shadowing_type_parameters # categories: errorProne + - avoid_single_cascade_in_expression_statements # categories: brevity,style + - avoid_slow_async_io # categories: nonPerformant + - avoid_type_to_string # categories: unintentional + - avoid_types_as_parameter_names # categories: unintentional + - avoid_types_on_closure_parameters # incompatibles: always_specify_types # categories: style + - avoid_unused_constructor_parameters # categories: unintentional + - avoid_void_async # categories: style + - await_only_futures # categories: style + - camel_case_extensions # categories: effectiveDart,style + - camel_case_types # categories: effectiveDart,style + - cancel_subscriptions # categories: errorProne,memoryLeaks + - cascade_invocations # categories: brevity,languageFeatureUsage,style + - cast_nullable_to_non_nullable # categories: errorProne + - close_sinks # categories: errorProne,memoryLeaks + - collection_methods_unrelated_type # categories: unintentional + - combinators_ordering # categories: style + - comment_references # categories: documentationCommentMaintenance + - conditional_uri_does_not_exist # categories: errorProne + - constant_identifier_names # categories: style + - control_flow_in_finally # categories: errorProne + - curly_braces_in_flow_control_structures # categories: errorProne + - dangling_library_doc_comments # categories: documentationCommentMaintenance + - depend_on_referenced_packages # categories: pub + - deprecated_consistency # categories: style + - deprecated_member_use_from_same_package # categories: languageFeatureUsage + - directives_ordering # categories: style + - discarded_futures # categories: errorProne + - do_not_use_environment # categories: errorProne + - document_ignores # categories: style + - empty_catches # categories: style + - empty_constructor_bodies # categories: brevity,effectiveDart,style + - empty_statements # categories: errorProne + - eol_at_end_of_file # categories: style + - exhaustive_cases # categories: errorProne + - file_names # categories: style + - flutter_style_todos # categories: style + - hash_and_equals # categories: errorProne + - implementation_imports # categories: style + - implicit_call_tearoffs # categories: style + - implicit_reopen # categories: errorProne + - invalid_case_patterns # categories: languageFeatureUsage + - invalid_runtime_check_with_js_interop_types # categories: errorProne,web + - join_return_with_assignment # categories: brevity,style + - leading_newlines_in_multiline_strings # categories: style + - library_annotations # categories: style + - library_names # categories: style + - library_prefixes # categories: style + - library_private_types_in_public_api # categories: publicInterface + - lines_longer_than_80_chars # categories: style + - literal_only_boolean_expressions # categories: unusedCode + - matching_super_parameters # categories: style + - missing_code_block_language_in_doc_comment # categories: errorProne + - missing_whitespace_between_adjacent_strings # categories: errorProne + - no_adjacent_strings_in_list # categories: style + - no_default_cases # categories: style + - no_duplicate_case_values # categories: errorProne + - no_leading_underscores_for_library_prefixes # categories: style + - no_leading_underscores_for_local_identifiers # categories: style + - no_literal_bool_comparisons # categories: effectiveDart,style + - no_runtimeType_toString # categories: nonPerformant + - no_self_assignments # categories: unintentional + - no_wildcard_variable_uses # categories: languageFeatureUsage,unintentional + - non_constant_identifier_names # categories: style + - noop_primitive_operations # categories: style + - null_check_on_nullable_type_parameter # categories: style + - null_closures # categories: errorProne + - omit_local_variable_types # incompatibles: always_specify_types,specify_nonobvious_local_variable_types # categories: style + - omit_obvious_local_variable_types # incompatibles: always_specify_types # categories: style + - omit_obvious_property_types # incompatibles: always_specify_types # categories: style + - one_member_abstracts # categories: effectiveDart,languageFeatureUsage,style + - only_throw_errors # categories: style + - overridden_fields # categories: style + - package_names # categories: style + - package_prefixed_library_names # categories: style + - parameter_assignments # categories: style + - prefer_adjacent_string_concatenation # categories: style + - prefer_asserts_in_initializer_lists # categories: style + - prefer_asserts_with_message # categories: style + - prefer_collection_literals # categories: brevity,style + - prefer_conditional_assignment # categories: brevity,style + - prefer_const_constructors # categories: style + - prefer_const_constructors_in_immutables # categories: style + - prefer_const_declarations # categories: style + - prefer_const_literals_to_create_immutables # categories: style + - prefer_constructors_over_static_methods # categories: style + - prefer_contains # categories: style + - prefer_double_quotes # incompatibles: prefer_single_quotes # categories: style + - prefer_expression_function_bodies # categories: brevity,style + - prefer_final_fields # categories: effectiveDart,style + - prefer_final_in_for_each # incompatibles: unnecessary_final # categories: style + - prefer_final_locals # incompatibles: unnecessary_final # categories: style + - prefer_final_parameters # incompatibles: unnecessary_final,avoid_final_parameters # categories: style + - prefer_for_elements_to_map_fromIterable # categories: brevity,style + - prefer_foreach # categories: style + - prefer_function_declarations_over_variables # categories: effectiveDart,style + - prefer_generic_function_type_aliases # categories: style + - prefer_if_elements_to_conditional_expressions # categories: brevity,style + - prefer_if_null_operators # categories: brevity,style + - prefer_initializing_formals # categories: brevity,style + - prefer_inlined_adds # categories: brevity,style + - prefer_int_literals # categories: style + - prefer_interpolation_to_compose_strings # categories: style + - prefer_is_empty # categories: errorProne + - prefer_is_not_empty # categories: style + - prefer_is_not_operator # categories: brevity,style + - prefer_iterable_whereType # categories: style + - prefer_mixin # categories: languageFeatureUsage,style + - prefer_null_aware_method_calls # categories: brevity,style + - prefer_null_aware_operators # categories: brevity,style + - prefer_relative_imports # incompatibles: always_use_package_imports # categories: errorProne + - prefer_single_quotes # incompatibles: prefer_double_quotes # categories: style + - prefer_spread_collections # categories: brevity,style + - prefer_typing_uninitialized_variables # categories: errorProne,unintentional + - prefer_void_to_null # categories: errorProne + - provide_deprecation_message # categories: publicInterface + - public_member_api_docs # categories: publicInterface,style + - recursive_getters # categories: errorProne,unintentional + - require_trailing_commas # categories: style + - secure_pubspec_urls # categories: pub + - slash_for_doc_comments # categories: effectiveDart,style + - sort_constructors_first # categories: style + - sort_pub_dependencies # categories: pub + - sort_unnamed_constructors_first # categories: style + - specify_nonobvious_local_variable_types # incompatibles: omit_local_variable_types # categories: style + - specify_nonobvious_property_types # categories: style + - strict_top_level_inference # categories: style + - test_types_in_equals # categories: errorProne + - throw_in_finally # categories: errorProne + - tighten_type_of_initializing_formals # categories: style + - type_annotate_public_apis # categories: effectiveDart,publicInterface + - type_init_formals # categories: effectiveDart,style + - type_literal_in_constant_pattern # categories: style + - unawaited_futures # categories: style + - unintended_html_in_doc_comment # categories: errorProne + - unnecessary_async # categories: style + - unnecessary_await_in_return # categories: style + - unnecessary_brace_in_string_interps # categories: brevity,style + - unnecessary_breaks # categories: brevity,style + - unnecessary_const # categories: brevity,style + - unnecessary_constructor_name # categories: brevity,style + - unnecessary_final # incompatibles: prefer_final_locals,prefer_final_parameters,prefer_final_in_for_each # categories: effectiveDart,style + - unnecessary_getters_setters # categories: effectiveDart,style + - unnecessary_lambdas # categories: style + - unnecessary_late # categories: style + - unnecessary_library_directive # categories: brevity + - unnecessary_library_name # categories: brevity,languageFeatureUsage,style + - unnecessary_new # categories: brevity,languageFeatureUsage,style + - unnecessary_null_aware_assignments # categories: brevity,effectiveDart,style + - unnecessary_null_aware_operator_on_extension_on_nullable # categories: style + - unnecessary_null_checks # categories: brevity,style + - unnecessary_null_in_if_null_operators # categories: style + - unnecessary_nullable_for_final_variable_declarations # categories: style + - unnecessary_overrides # categories: style + - unnecessary_parenthesis # categories: brevity,style + - unnecessary_raw_strings # categories: brevity,style + - unnecessary_statements # categories: brevity,unintentional + - unnecessary_string_escapes # categories: brevity,style + - unnecessary_string_interpolations # categories: brevity,style + - unnecessary_this # categories: brevity,effectiveDart,style + - unnecessary_to_list_in_spreads # categories: brevity + - unnecessary_underscores # categories: brevity,style + - unreachable_from_main # categories: unusedCode + - unrelated_type_equality_checks # categories: unintentional + - unsafe_variance # categories: errorProne + - use_enums # categories: style + - use_function_type_syntax_for_parameters # categories: style + - use_if_null_to_convert_nulls_to_bools # categories: effectiveDart,style + - use_is_even_rather_than_modulo # categories: style + - use_late_for_private_fields_and_variables # categories: style + - use_named_constants # categories: style + - use_raw_strings # categories: style + - use_rethrow_when_possible # categories: brevity,effectiveDart + - use_setters_to_change_properties # categories: style + - use_string_buffers # categories: nonPerformant + - use_string_in_part_of_directives # categories: effectiveDart,style + - use_super_parameters # categories: brevity + - use_test_throws_matchers # categories: style + - use_to_and_as_if_applicable # categories: effectiveDart,style + - use_truncating_division # categories: languageFeatureUsage + - valid_regexps # categories: unintentional + - void_checks # categories: style diff --git a/packages/yumemi_lints/lib/dart/3.7/recommended.yaml b/packages/yumemi_lints/lib/dart/3.7/recommended.yaml new file mode 100644 index 0000000..905695e --- /dev/null +++ b/packages/yumemi_lints/lib/dart/3.7/recommended.yaml @@ -0,0 +1,102 @@ +# GENERATED CODE - DO NOT MODIFY BY HAND + +include: package:yumemi_lints/dart/3.7/all.yaml + +analyzer: + language: + # Increase safety as much as possible. + strict-casts: true + strict-inference: true + strict-raw-types: true + errors: + # By including all.yaml, some rules will conflict. These warnings will be addressed within this file. + included_file_warning: ignore + + # Members annotated with `visibleForTesting` should not be referenced outside of the library in which they are declared or libraries within the test directory. + invalid_use_of_visible_for_testing_member: error + + # Superclass members should not be unintentionally overridden, as this reduces readability. + annotate_overrides: error + + # Class members should not be unintentionally redeclared, as this reduces readability. + annotate_redeclares: error + + # When using implements, you do not inherit the method body of `==`, making it nearly impossible to follow the contract of `==`. + avoid_implementing_value_types: error + + # Parameter names in overridden methods that do not match the original method's parameter names are usually considered typos. + avoid_renaming_method_parameters: error + + # Shadowing type parameters should not be used, as this reduces readability. + avoid_shadowing_type_parameters: error + + # Should not reference files that do not exist for conditional imports, as this will result in possible runtime failures. + conditional_uri_does_not_exist: error + + # When importing a package, add it as a dependency in pubspec to impose constraints on the dependency, protecting against breaking changes. + depend_on_referenced_packages: error + + # Some file systems are not case-sensitive, so many projects require filenames to be all lowercase. + file_names: error + + # Files in the package's lib/src directory are not public APIs and should not be imported. + implementation_imports: error + + # Some file systems are not case-sensitive, so many projects require filenames to be all lowercase. + library_names: error + + # Super parameter names that do not match the parameter name of the corresponding super constructor are usually considered typos. + matching_super_parameters: error + + # When unwrapping to a generic type parameter T, using `x!` can lead to a runtime error if T is given a nullable type, so you should use `x as T` instead. + null_check_on_nullable_type_parameter: error + + # If package names are not determined according to the rules, unexpected problems may occur. + package_names: error + + # Recursive getters are usually considered typos. + recursive_getters: error + + # Should not be assigned to `void`. + void_checks: error + +linter: + rules: + # Conflicts with enabling `avoid_types_on_closure_parameters`, `omit_local_variable_types`, `omit_obvious_local_variable_types`, `omit_obvious_property_types`. + always_specify_types: false + + # Conflicts with enabling `strict-raw-types`. + avoid_annotating_with_dynamic: false + + # There are cases that are warned but not fixed by `dart fix`. + cascade_invocations: false + + # Don't use Flutter-style todos. + flutter_style_todos: false + + # May add more methods later. + one_member_abstracts: false + + # Conflicts with enabling `prefer_single_quotes`. + prefer_double_quotes: false + + # Using `=>` has sometimes to reduce readability. + prefer_expression_function_bodies: false + + # Conflicts with enabling `avoid_final_parameters`. + prefer_final_parameters: false + + # Conflicts with enabling `always_use_package_imports`. + prefer_relative_imports: false + + # Don't often develop package. + public_member_api_docs: false + + # Conflicts with enabling `omit_local_variable_types`. + specify_nonobvious_local_variable_types: false + + # Conflicts with enabling `prefer_final_locals`. + unnecessary_final: false + + # Don't trigger warnings with methods for simple state updates, among other things. + use_setters_to_change_properties: false diff --git a/packages/yumemi_lints/lib/flutter/3.29/all.yaml b/packages/yumemi_lints/lib/flutter/3.29/all.yaml new file mode 100644 index 0000000..5ba96cc --- /dev/null +++ b/packages/yumemi_lints/lib/flutter/3.29/all.yaml @@ -0,0 +1,18 @@ +# GENERATED CODE - DO NOT MODIFY BY HAND + +include: package:yumemi_lints/dart/3.7/all.yaml + +linter: + rules: + - avoid_unnecessary_containers # categories: flutter,style + - avoid_web_libraries_in_flutter # categories: errorProne,flutter,web + - diagnostic_describe_all_properties # categories: errorProne,flutter + - no_logic_in_create_state # categories: errorProne,flutter + - sized_box_for_whitespace # categories: flutter,style + - sized_box_shrink_expand # categories: flutter,style + - sort_child_properties_last # categories: flutter,style + - use_build_context_synchronously # categories: errorProne,flutter + - use_colored_box # categories: flutter,style + - use_decorated_box # categories: flutter,style + - use_full_hex_values_for_flutter_colors # categories: flutter,style + - use_key_in_widget_constructors # categories: flutter,style diff --git a/packages/yumemi_lints/lib/flutter/3.29/recommended.yaml b/packages/yumemi_lints/lib/flutter/3.29/recommended.yaml new file mode 100644 index 0000000..e12d7db --- /dev/null +++ b/packages/yumemi_lints/lib/flutter/3.29/recommended.yaml @@ -0,0 +1,102 @@ +# GENERATED CODE - DO NOT MODIFY BY HAND + +include: package:yumemi_lints/flutter/3.29/all.yaml + +analyzer: + language: + # Increase safety as much as possible. + strict-casts: true + strict-inference: true + strict-raw-types: true + errors: + # By including all.yaml, some rules will conflict. These warnings will be addressed within this file. + included_file_warning: ignore + + # Members annotated with `visibleForTesting` should not be referenced outside of the library in which they are declared or libraries within the test directory. + invalid_use_of_visible_for_testing_member: error + + # Superclass members should not be unintentionally overridden, as this reduces readability. + annotate_overrides: error + + # Class members should not be unintentionally redeclared, as this reduces readability. + annotate_redeclares: error + + # When using implements, you do not inherit the method body of `==`, making it nearly impossible to follow the contract of `==`. + avoid_implementing_value_types: error + + # Parameter names in overridden methods that do not match the original method's parameter names are usually considered typos. + avoid_renaming_method_parameters: error + + # Shadowing type parameters should not be used, as this reduces readability. + avoid_shadowing_type_parameters: error + + # Should not reference files that do not exist for conditional imports, as this will result in possible runtime failures. + conditional_uri_does_not_exist: error + + # When importing a package, add it as a dependency in pubspec to impose constraints on the dependency, protecting against breaking changes. + depend_on_referenced_packages: error + + # Some file systems are not case-sensitive, so many projects require filenames to be all lowercase. + file_names: error + + # Files in the package's lib/src directory are not public APIs and should not be imported. + implementation_imports: error + + # Some file systems are not case-sensitive, so many projects require filenames to be all lowercase. + library_names: error + + # Super parameter names that do not match the parameter name of the corresponding super constructor are usually considered typos. + matching_super_parameters: error + + # When unwrapping to a generic type parameter T, using `x!` can lead to a runtime error if T is given a nullable type, so you should use `x as T` instead. + null_check_on_nullable_type_parameter: error + + # If package names are not determined according to the rules, unexpected problems may occur. + package_names: error + + # Recursive getters are usually considered typos. + recursive_getters: error + + # Should not be assigned to `void`. + void_checks: error + +linter: + rules: + # Conflicts with enabling `avoid_types_on_closure_parameters`, `omit_local_variable_types`, `omit_obvious_local_variable_types`, `omit_obvious_property_types`. + always_specify_types: false + + # Conflicts with enabling `strict-raw-types`. + avoid_annotating_with_dynamic: false + + # There are cases that are warned but not fixed by `dart fix`. + cascade_invocations: false + + # Don't use Flutter-style todos. + flutter_style_todos: false + + # May add more methods later. + one_member_abstracts: false + + # Conflicts with enabling `prefer_single_quotes`. + prefer_double_quotes: false + + # Using `=>` has sometimes to reduce readability. + prefer_expression_function_bodies: false + + # Conflicts with enabling `avoid_final_parameters`. + prefer_final_parameters: false + + # Conflicts with enabling `always_use_package_imports`. + prefer_relative_imports: false + + # Don't often develop package. + public_member_api_docs: false + + # Conflicts with enabling `omit_local_variable_types`. + specify_nonobvious_local_variable_types: false + + # Conflicts with enabling `prefer_final_locals`. + unnecessary_final: false + + # Don't trigger warnings with methods for simple state updates, among other things. + use_setters_to_change_properties: false