sort lints to make maintenance easier (#13231)
This commit is contained in:
parent
4f240a4dda
commit
1d7a22fba0
@ -47,29 +47,7 @@ linter:
|
|||||||
rules:
|
rules:
|
||||||
# these rules are documented on and in the same order as
|
# these rules are documented on and in the same order as
|
||||||
# the Dart Lint rules page to make maintenance easier
|
# the Dart Lint rules page to make maintenance easier
|
||||||
# http://dart-lang.github.io/linter/lints/
|
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
|
||||||
|
|
||||||
# === error rules ===
|
|
||||||
- avoid_empty_else
|
|
||||||
- avoid_slow_async_io
|
|
||||||
- cancel_subscriptions
|
|
||||||
# - close_sinks # https://github.com/flutter/flutter/issues/5789
|
|
||||||
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
|
|
||||||
- control_flow_in_finally
|
|
||||||
- empty_statements
|
|
||||||
- hash_and_equals
|
|
||||||
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
|
|
||||||
- iterable_contains_unrelated_type
|
|
||||||
- list_remove_unrelated_type
|
|
||||||
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
|
|
||||||
- no_adjacent_strings_in_list
|
|
||||||
- no_duplicate_case_values
|
|
||||||
- test_types_in_equals
|
|
||||||
- throw_in_finally
|
|
||||||
- unrelated_type_equality_checks
|
|
||||||
- valid_regexps
|
|
||||||
|
|
||||||
# === style rules ===
|
|
||||||
- always_declare_return_types
|
- always_declare_return_types
|
||||||
- always_put_control_body_on_new_line
|
- always_put_control_body_on_new_line
|
||||||
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
|
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
|
||||||
@ -81,6 +59,7 @@ linter:
|
|||||||
# - avoid_catches_without_on_clauses # we do this commonly
|
# - avoid_catches_without_on_clauses # we do this commonly
|
||||||
# - avoid_catching_errors # we do this commonly
|
# - avoid_catching_errors # we do this commonly
|
||||||
- avoid_classes_with_only_static_members
|
- avoid_classes_with_only_static_members
|
||||||
|
- avoid_empty_else
|
||||||
- avoid_function_literals_in_foreach_calls
|
- avoid_function_literals_in_foreach_calls
|
||||||
- avoid_init_to_null
|
- avoid_init_to_null
|
||||||
- avoid_null_checks_in_equality_operators
|
- avoid_null_checks_in_equality_operators
|
||||||
@ -89,28 +68,44 @@ linter:
|
|||||||
# - avoid_returning_null # we do this commonly
|
# - avoid_returning_null # we do this commonly
|
||||||
# - avoid_returning_this # https://github.com/dart-lang/linter/issues/842
|
# - avoid_returning_this # https://github.com/dart-lang/linter/issues/842
|
||||||
# - avoid_setters_without_getters # not yet tested
|
# - avoid_setters_without_getters # not yet tested
|
||||||
|
- avoid_slow_async_io
|
||||||
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
|
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
|
||||||
|
# - avoid_unused_constructor_parameters # not yet tested
|
||||||
- await_only_futures
|
- await_only_futures
|
||||||
- camel_case_types
|
- camel_case_types
|
||||||
|
- cancel_subscriptions
|
||||||
# - cascade_invocations # not yet tested
|
# - cascade_invocations # not yet tested
|
||||||
|
# - close_sinks # https://github.com/flutter/flutter/issues/5789
|
||||||
|
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
|
||||||
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
|
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
|
||||||
|
- control_flow_in_finally
|
||||||
- directives_ordering
|
- directives_ordering
|
||||||
- empty_catches
|
- empty_catches
|
||||||
- empty_constructor_bodies
|
- empty_constructor_bodies
|
||||||
|
- empty_statements
|
||||||
|
- hash_and_equals
|
||||||
- implementation_imports
|
- implementation_imports
|
||||||
|
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
|
||||||
|
- iterable_contains_unrelated_type
|
||||||
# - join_return_with_assignment # not yet tested
|
# - join_return_with_assignment # not yet tested
|
||||||
- library_names
|
- library_names
|
||||||
- library_prefixes
|
- library_prefixes
|
||||||
|
- list_remove_unrelated_type
|
||||||
|
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
|
||||||
|
- no_adjacent_strings_in_list
|
||||||
|
- no_duplicate_case_values
|
||||||
- non_constant_identifier_names
|
- non_constant_identifier_names
|
||||||
# - omit_local_variable_types # opposite of always_specify_types
|
# - omit_local_variable_types # opposite of always_specify_types
|
||||||
# - one_member_abstracts # too many false positives
|
# - one_member_abstracts # too many false positives
|
||||||
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
|
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
|
||||||
- overridden_fields
|
- overridden_fields
|
||||||
- package_api_docs
|
- package_api_docs
|
||||||
|
- package_names
|
||||||
- package_prefixed_library_names
|
- package_prefixed_library_names
|
||||||
# - parameter_assignments # we do this commonly
|
# - parameter_assignments # we do this commonly
|
||||||
- prefer_adjacent_string_concatenation
|
- prefer_adjacent_string_concatenation
|
||||||
- prefer_asserts_in_initializer_lists
|
- prefer_asserts_in_initializer_lists
|
||||||
|
# - prefer_bool_in_asserts # not yet tested
|
||||||
- prefer_collection_literals
|
- prefer_collection_literals
|
||||||
- prefer_conditional_assignment
|
- prefer_conditional_assignment
|
||||||
- prefer_const_constructors
|
- prefer_const_constructors
|
||||||
@ -127,12 +122,15 @@ linter:
|
|||||||
- prefer_is_empty
|
- prefer_is_empty
|
||||||
- prefer_is_not_empty
|
- prefer_is_not_empty
|
||||||
- prefer_single_quotes
|
- prefer_single_quotes
|
||||||
|
- prefer_typing_uninitialized_variables
|
||||||
# - 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
|
- recursive_getters
|
||||||
- slash_for_doc_comments
|
- slash_for_doc_comments
|
||||||
- sort_constructors_first
|
- sort_constructors_first
|
||||||
- sort_unnamed_constructors_first
|
- sort_unnamed_constructors_first
|
||||||
- super_goes_last
|
- super_goes_last
|
||||||
|
- test_types_in_equals
|
||||||
|
- throw_in_finally
|
||||||
# - type_annotate_public_apis # subset of always_specify_types
|
# - type_annotate_public_apis # subset of always_specify_types
|
||||||
- type_init_formals
|
- type_init_formals
|
||||||
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
|
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
|
||||||
@ -142,11 +140,11 @@ linter:
|
|||||||
- unnecessary_null_aware_assignments
|
- unnecessary_null_aware_assignments
|
||||||
- unnecessary_null_in_if_null_operators
|
- unnecessary_null_in_if_null_operators
|
||||||
- unnecessary_overrides
|
- unnecessary_overrides
|
||||||
|
# - unnecessary_statements # not yet tested
|
||||||
- unnecessary_this
|
- unnecessary_this
|
||||||
|
- unrelated_type_equality_checks
|
||||||
- use_rethrow_when_possible
|
- use_rethrow_when_possible
|
||||||
# - use_setters_to_change_properties # not yet tested
|
# - use_setters_to_change_properties # not yet tested
|
||||||
# - use_string_buffers # https://github.com/dart-lang/linter/pull/664
|
# - use_string_buffers # https://github.com/dart-lang/linter/pull/664
|
||||||
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
|
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
|
||||||
|
- valid_regexps
|
||||||
# === pub rules ===
|
|
||||||
- package_names
|
|
||||||
|
@ -40,29 +40,7 @@ linter:
|
|||||||
rules:
|
rules:
|
||||||
# these rules are documented on and in the same order as
|
# these rules are documented on and in the same order as
|
||||||
# the Dart Lint rules page to make maintenance easier
|
# the Dart Lint rules page to make maintenance easier
|
||||||
# http://dart-lang.github.io/linter/lints/
|
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
|
||||||
|
|
||||||
# === error rules ===
|
|
||||||
- avoid_empty_else
|
|
||||||
- avoid_slow_async_io
|
|
||||||
- cancel_subscriptions
|
|
||||||
# - close_sinks # https://github.com/flutter/flutter/issues/5789
|
|
||||||
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
|
|
||||||
- control_flow_in_finally
|
|
||||||
- empty_statements
|
|
||||||
- hash_and_equals
|
|
||||||
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
|
|
||||||
- iterable_contains_unrelated_type
|
|
||||||
- list_remove_unrelated_type
|
|
||||||
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
|
|
||||||
- no_adjacent_strings_in_list
|
|
||||||
- no_duplicate_case_values
|
|
||||||
- test_types_in_equals
|
|
||||||
- throw_in_finally
|
|
||||||
- unrelated_type_equality_checks
|
|
||||||
- valid_regexps
|
|
||||||
|
|
||||||
# === style rules ===
|
|
||||||
- always_declare_return_types
|
- always_declare_return_types
|
||||||
- always_put_control_body_on_new_line
|
- always_put_control_body_on_new_line
|
||||||
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
|
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
|
||||||
@ -74,6 +52,7 @@ linter:
|
|||||||
# - avoid_catches_without_on_clauses # we do this commonly
|
# - avoid_catches_without_on_clauses # we do this commonly
|
||||||
# - avoid_catching_errors # we do this commonly
|
# - avoid_catching_errors # we do this commonly
|
||||||
- avoid_classes_with_only_static_members
|
- avoid_classes_with_only_static_members
|
||||||
|
- avoid_empty_else
|
||||||
- avoid_function_literals_in_foreach_calls
|
- avoid_function_literals_in_foreach_calls
|
||||||
- avoid_init_to_null
|
- avoid_init_to_null
|
||||||
- avoid_null_checks_in_equality_operators
|
- avoid_null_checks_in_equality_operators
|
||||||
@ -82,28 +61,44 @@ linter:
|
|||||||
# - avoid_returning_null # we do this commonly
|
# - avoid_returning_null # we do this commonly
|
||||||
# - avoid_returning_this # https://github.com/dart-lang/linter/issues/842
|
# - avoid_returning_this # https://github.com/dart-lang/linter/issues/842
|
||||||
# - avoid_setters_without_getters # not yet tested
|
# - avoid_setters_without_getters # not yet tested
|
||||||
|
- avoid_slow_async_io
|
||||||
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
|
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
|
||||||
|
# - avoid_unused_constructor_parameters # not yet tested
|
||||||
- await_only_futures
|
- await_only_futures
|
||||||
- camel_case_types
|
- camel_case_types
|
||||||
|
- cancel_subscriptions
|
||||||
# - cascade_invocations # not yet tested
|
# - cascade_invocations # not yet tested
|
||||||
|
# - close_sinks # https://github.com/flutter/flutter/issues/5789
|
||||||
|
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
|
||||||
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
|
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
|
||||||
|
- control_flow_in_finally
|
||||||
- directives_ordering
|
- directives_ordering
|
||||||
- empty_catches
|
- empty_catches
|
||||||
- empty_constructor_bodies
|
- empty_constructor_bodies
|
||||||
|
- empty_statements
|
||||||
|
- hash_and_equals
|
||||||
- implementation_imports
|
- implementation_imports
|
||||||
|
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
|
||||||
|
- iterable_contains_unrelated_type
|
||||||
# - join_return_with_assignment # not yet tested
|
# - join_return_with_assignment # not yet tested
|
||||||
- library_names
|
- library_names
|
||||||
- library_prefixes
|
- library_prefixes
|
||||||
|
- list_remove_unrelated_type
|
||||||
|
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
|
||||||
|
- no_adjacent_strings_in_list
|
||||||
|
- no_duplicate_case_values
|
||||||
- non_constant_identifier_names
|
- non_constant_identifier_names
|
||||||
# - omit_local_variable_types # opposite of always_specify_types
|
# - omit_local_variable_types # opposite of always_specify_types
|
||||||
# - one_member_abstracts # too many false positives
|
# - one_member_abstracts # too many false positives
|
||||||
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
|
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
|
||||||
- overridden_fields
|
- overridden_fields
|
||||||
- package_api_docs
|
- package_api_docs
|
||||||
|
- package_names
|
||||||
- package_prefixed_library_names
|
- package_prefixed_library_names
|
||||||
# - parameter_assignments # we do this commonly
|
# - parameter_assignments # we do this commonly
|
||||||
- prefer_adjacent_string_concatenation
|
- prefer_adjacent_string_concatenation
|
||||||
- prefer_asserts_in_initializer_lists
|
- prefer_asserts_in_initializer_lists
|
||||||
|
# - prefer_bool_in_asserts # not yet tested
|
||||||
- prefer_collection_literals
|
- prefer_collection_literals
|
||||||
- prefer_conditional_assignment
|
- prefer_conditional_assignment
|
||||||
- prefer_const_constructors
|
- prefer_const_constructors
|
||||||
@ -120,12 +115,15 @@ linter:
|
|||||||
- prefer_is_empty
|
- prefer_is_empty
|
||||||
- prefer_is_not_empty
|
- prefer_is_not_empty
|
||||||
- prefer_single_quotes
|
- prefer_single_quotes
|
||||||
- public_member_api_docs # this is the only difference from analysis_options_repo.yaml
|
- prefer_typing_uninitialized_variables
|
||||||
|
- public_member_api_docs # this is the only difference from analysis_options.yaml
|
||||||
- recursive_getters
|
- recursive_getters
|
||||||
- slash_for_doc_comments
|
- slash_for_doc_comments
|
||||||
- sort_constructors_first
|
- sort_constructors_first
|
||||||
- sort_unnamed_constructors_first
|
- sort_unnamed_constructors_first
|
||||||
- super_goes_last
|
- super_goes_last
|
||||||
|
- test_types_in_equals
|
||||||
|
- throw_in_finally
|
||||||
# - type_annotate_public_apis # subset of always_specify_types
|
# - type_annotate_public_apis # subset of always_specify_types
|
||||||
- type_init_formals
|
- type_init_formals
|
||||||
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
|
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
|
||||||
@ -135,11 +133,11 @@ linter:
|
|||||||
- unnecessary_null_aware_assignments
|
- unnecessary_null_aware_assignments
|
||||||
- unnecessary_null_in_if_null_operators
|
- unnecessary_null_in_if_null_operators
|
||||||
- unnecessary_overrides
|
- unnecessary_overrides
|
||||||
|
# - unnecessary_statements # not yet tested
|
||||||
- unnecessary_this
|
- unnecessary_this
|
||||||
|
- unrelated_type_equality_checks
|
||||||
- use_rethrow_when_possible
|
- use_rethrow_when_possible
|
||||||
# - use_setters_to_change_properties # not yet tested
|
# - use_setters_to_change_properties # not yet tested
|
||||||
# - use_string_buffers # https://github.com/dart-lang/linter/pull/664
|
# - use_string_buffers # https://github.com/dart-lang/linter/pull/664
|
||||||
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
|
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
|
||||||
|
- valid_regexps
|
||||||
# === pub rules ===
|
|
||||||
- package_names
|
|
||||||
|
@ -37,44 +37,37 @@ linter:
|
|||||||
rules:
|
rules:
|
||||||
# these rules are documented on and in the same order as
|
# these rules are documented on and in the same order as
|
||||||
# the Dart Lint rules page to make maintenance easier
|
# the Dart Lint rules page to make maintenance easier
|
||||||
# http://dart-lang.github.io/linter/lints/
|
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
|
||||||
|
|
||||||
# === error rules ===
|
|
||||||
- avoid_empty_else
|
|
||||||
- cancel_subscriptions
|
|
||||||
- close_sinks
|
|
||||||
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
|
|
||||||
- control_flow_in_finally
|
|
||||||
- empty_statements
|
|
||||||
- hash_and_equals
|
|
||||||
# - invariant_booleans
|
|
||||||
# - iterable_contains_unrelated_type
|
|
||||||
# - list_remove_unrelated_type
|
|
||||||
# - literal_only_boolean_expressions
|
|
||||||
- test_types_in_equals
|
|
||||||
- throw_in_finally
|
|
||||||
- unrelated_type_equality_checks
|
|
||||||
- valid_regexps
|
|
||||||
|
|
||||||
# === style rules ===
|
|
||||||
# - always_declare_return_types
|
# - always_declare_return_types
|
||||||
# - always_specify_types
|
# - always_specify_types
|
||||||
# - annotate_overrides
|
# - annotate_overrides
|
||||||
# - avoid_as
|
# - avoid_as
|
||||||
|
- avoid_empty_else
|
||||||
- avoid_init_to_null
|
- avoid_init_to_null
|
||||||
- avoid_return_types_on_setters
|
- avoid_return_types_on_setters
|
||||||
- await_only_futures
|
- await_only_futures
|
||||||
- camel_case_types
|
- camel_case_types
|
||||||
|
- cancel_subscriptions
|
||||||
|
- close_sinks
|
||||||
|
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
|
||||||
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
|
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
|
||||||
|
- control_flow_in_finally
|
||||||
- empty_constructor_bodies
|
- empty_constructor_bodies
|
||||||
|
- empty_statements
|
||||||
|
- hash_and_equals
|
||||||
- implementation_imports
|
- implementation_imports
|
||||||
|
# - invariant_booleans
|
||||||
|
# - iterable_contains_unrelated_type
|
||||||
- library_names
|
- library_names
|
||||||
# - library_prefixes
|
# - library_prefixes
|
||||||
|
# - list_remove_unrelated_type
|
||||||
|
# - literal_only_boolean_expressions
|
||||||
- non_constant_identifier_names
|
- non_constant_identifier_names
|
||||||
# - one_member_abstracts
|
# - one_member_abstracts
|
||||||
# - only_throw_errors
|
# - only_throw_errors
|
||||||
# - overridden_fields
|
# - overridden_fields
|
||||||
- package_api_docs
|
- package_api_docs
|
||||||
|
- package_names
|
||||||
- package_prefixed_library_names
|
- package_prefixed_library_names
|
||||||
- prefer_is_not_empty
|
- prefer_is_not_empty
|
||||||
# - public_member_api_docs
|
# - public_member_api_docs
|
||||||
@ -82,11 +75,12 @@ linter:
|
|||||||
# - sort_constructors_first
|
# - sort_constructors_first
|
||||||
# - sort_unnamed_constructors_first
|
# - sort_unnamed_constructors_first
|
||||||
- super_goes_last
|
- super_goes_last
|
||||||
|
- test_types_in_equals
|
||||||
|
- throw_in_finally
|
||||||
# - type_annotate_public_apis # subset of always_specify_types
|
# - type_annotate_public_apis # subset of always_specify_types
|
||||||
- type_init_formals
|
- type_init_formals
|
||||||
# - unawaited_futures
|
# - unawaited_futures
|
||||||
- unnecessary_brace_in_string_interps
|
- unnecessary_brace_in_string_interps
|
||||||
- unnecessary_getters_setters
|
- unnecessary_getters_setters
|
||||||
|
- unrelated_type_equality_checks
|
||||||
# === pub rules ===
|
- valid_regexps
|
||||||
- package_names
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user