Created
October 22, 2019 10:38
-
-
Save charafau/42ea98e17b8c629947eb90ab9d1ea72e to your computer and use it in GitHub Desktop.
Useful flutter list rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.dartlang.org/guides/language/analysis-options | |
include: package:pedantic/analysis_options.yaml | |
analyzer: | |
strong-mode: | |
implicit-dynamic: false | |
errors: | |
# treat missing required parameters as a warning (not a hint) | |
missing_required_param: warning | |
# treat missing returns as a warning (not a hint) | |
missing_return: warning | |
linter: | |
rules: | |
# these rules are documented on and in the same order as | |
# the Dart Lint rules page to make maintenance easier | |
# https://github.com/dart-lang/linter/blob/master/example/all.yaml | |
- always_declare_return_types | |
- always_put_control_body_on_new_line | |
- always_require_non_null_named_parameters | |
- avoid_bool_literals_in_conditional_expressions | |
- avoid_catches_without_on_clauses | |
- avoid_catching_errors | |
- avoid_classes_with_only_static_members | |
- avoid_empty_else | |
- avoid_init_to_null | |
- avoid_relative_lib_imports | |
- avoid_return_types_on_setters | |
- avoid_returning_null_for_void | |
- avoid_setters_without_getters | |
- avoid_shadowing_type_parameters | |
- avoid_single_cascade_in_expression_statements | |
- avoid_types_as_parameter_names | |
- avoid_unused_constructor_parameters | |
- avoid_void_async | |
- await_only_futures | |
- camel_case_types | |
- cancel_subscriptions | |
- close_sinks | |
- curly_braces_in_flow_control_structures | |
- directives_ordering | |
- empty_catches | |
- empty_constructor_bodies | |
- empty_statements | |
- file_names | |
- flutter_style_todos | |
- hash_and_equals | |
- literal_only_boolean_expressions | |
- no_duplicate_case_values | |
- non_constant_identifier_names | |
- null_closures | |
- overridden_fields | |
- package_api_docs | |
- package_names | |
- package_prefixed_library_names | |
- parameter_assignments | |
- prefer_adjacent_string_concatenation | |
- prefer_asserts_in_initializer_lists | |
- prefer_collection_literals | |
- prefer_conditional_assignment | |
- prefer_const_declarations | |
- prefer_const_literals_to_create_immutables | |
- prefer_constructors_over_static_methods | |
- prefer_contains | |
- prefer_equal_for_default_values | |
- prefer_final_fields | |
- prefer_final_in_for_each | |
- prefer_final_locals | |
- prefer_for_elements_to_map_fromIterable | |
- prefer_foreach | |
- prefer_function_declarations_over_variables | |
- prefer_generic_function_type_aliases | |
- prefer_if_elements_to_conditional_expressions | |
- prefer_if_null_operators | |
- prefer_initializing_formals | |
- prefer_inlined_adds | |
- prefer_int_literals | |
- prefer_interpolation_to_compose_strings | |
- prefer_is_empty | |
- prefer_is_not_empty | |
- prefer_iterable_whereType | |
- prefer_null_aware_operators | |
- prefer_spread_collections | |
- prefer_typing_uninitialized_variables | |
- prefer_void_to_null | |
- recursive_getters | |
- slash_for_doc_comments | |
- sort_child_properties_last | |
- sort_pub_dependencies | |
- test_types_in_equals | |
- type_init_formals | |
- unnecessary_statements | |
- unawaited_futures | |
- unnecessary_await_in_return | |
- unnecessary_const | |
- unnecessary_lambdas | |
- unnecessary_new | |
- unnecessary_null_aware_assignments | |
- unnecessary_null_in_if_null_operators | |
- unnecessary_overrides | |
- unnecessary_parenthesis | |
- unnecessary_this | |
- use_full_hex_values_for_flutter_colors | |
- use_function_type_syntax_for_parameters | |
- use_rethrow_when_possible | |
- use_setters_to_change_properties | |
- use_string_buffers | |
- use_to_and_as_if_applicable | |
- valid_regexps | |
- void_checks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment