Skip to content

Commit

Permalink
Updated to match current coding best practices
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsydarel authored Jan 8, 2021
1 parent f9827fc commit 79295b4
Showing 1 changed file with 197 additions and 141 deletions.
338 changes: 197 additions & 141 deletions lib/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,191 +1,247 @@
# Defines a default set of lint rules enforced for
# projects at Google. For details and rationale,
# see https://github.com/dart-lang/pedantic#enabled-lints.
analyzer:
exclude: [ lib/**.g.dart, build/** ]
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors:
diagnostic_describe_all_properties: warning
use_key_in_widget_constructors: info
always_declare_return_types: error
always_put_control_body_on_new_line: error
always_put_required_named_parameters_first: error
always_require_non_null_named_parameters: error
always_specify_types: error
annotate_overrides: error
avoid_as: error
avoid_catches_without_on_clauses: warning
avoid_catching_errors: error
avoid_classes_with_only_static_members: info
avoid_equals_and_hash_code_on_mutable_classes: error
avoid_escaping_inner_quotes: warning
avoid_field_initializers_in_const_classes: error
avoid_implementing_value_types: error
avoid_init_to_null: warning
avoid_null_checks_in_equality_operators: warning
avoid_positional_boolean_parameters: warning
avoid_private_typedef_functions: error
avoid_redundant_argument_values: info
avoid_renaming_method_parameters: warning
avoid_return_types_on_setters: info
avoid_returning_null: warning
avoid_returning_null_for_void: warning
avoid_returning_this: info
avoid_setters_without_getters: warning
avoid_shadowing_type_parameters: error
avoid_single_cascade_in_expression_statements: warning
avoid_unnecessary_containers: error
avoid_unused_constructor_parameters: error
avoid_void_async: error
await_only_futures: warning
camel_case_extensions: warning
camel_case_types: error
cascade_invocations: info
cast_nullable_to_non_nullable: warning
constant_identifier_names: warning
curly_braces_in_flow_control_structures: warning
directives_ordering: info
empty_catches: warning
empty_constructor_bodies: warning
exhaustive_cases: error
file_names: error
flutter_style_todos: warning
implementation_imports: error
join_return_with_assignment: warning
library_names: error
library_prefixes: error
lines_longer_than_80_chars: warning
missing_whitespace_between_adjacent_strings: warning
no_runtimeType_toString: warning
non_constant_identifier_names: error
null_check_on_nullable_type_parameter: error
null_closures: warning
one_member_abstracts: warning
only_throw_errors: error
overridden_fields: warning
package_api_docs: error
parameter_assignments: error
prefer_adjacent_string_concatenation: warning
prefer_asserts_in_initializer_lists: warning
prefer_asserts_with_message: warning
prefer_collection_literals: warning
prefer_conditional_assignment: warning
prefer_const_constructors: error
prefer_const_constructors_in_immutables: error
prefer_contains: warning
prefer_final_fields: warning
prefer_final_in_for_each: warning
prefer_final_locals: warning
prefer_generic_function_type_aliases: warning
prefer_if_elements_to_conditional_expressions: warning
prefer_typing_uninitialized_variables: warning
provide_deprecation_message: error
public_member_api_docs: error
recursive_getters: error
sized_box_for_whitespace: error
type_annotate_public_apis: error
use_full_hex_values_for_flutter_colors: warning

# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
# Uncomment to specify additional rules.
linter:
rules:
# DESIGN
- use_to_and_as_if_applicable # prefer
- one_member_abstracts # avoid
- avoid_classes_with_only_static_members # avoid
- prefer_final_fields # prefer
- use_setters_to_change_properties
- avoid_setters_without_getters
- avoid_returning_null # avoid
- avoid_returning_this # avoid
- prefer_typing_uninitialized_variables # prefer
- omit_local_variable_types # avoid
- avoid_return_types_on_setters
- prefer_generic_function_type_aliases
- avoid_private_typedef_functions
- use_function_type_syntax_for_parameters # consider
- avoid_positional_boolean_parameters # avoid
- hash_and_equals
- avoid_null_checks_in_equality_operators
- avoid_types_as_parameter_names
# USAGE
- invalid_use_of_visible_for_testing_member
- avoid_relative_lib_imports # prefer
- prefer_adjacent_string_concatenation
- prefer_interpolation_to_compose_strings # prefer
- unnecessary_brace_in_string_interps # avoid
- prefer_collection_literals
- avoid_function_literals_in_foreach_calls # avoid
- prefer_iterable_whereType
- prefer_function_declarations_over_variables
- unnecessary_lambdas
- prefer_equal_for_default_values
- avoid_init_to_null
- unnecessary_getters_setters
- unnecessary_getters # prefer
- unnecessary_new
- missing_return
#- prefer_expression_function_bodies # consider
- unnecessary_this
- prefer_initializing_formals
- type_init_formals
- empty_constructor_bodies
- unnecessary_const
- avoid_catches_without_on_clauses # avoid
- use_rethrow_when_possible
- implementation_imports
# ERROR RULES
- always_use_package_imports
- avoid_empty_else
- avoid_print
- avoid_relative_lib_imports
- avoid_returning_null_for_future
- avoid_slow_async_io
- avoid_type_to_string
- avoid_types_as_parameter_names
- avoid_web_libraries_in_flutter
- cancel_subscriptions
- prefer_contains
- close_sinks
- comment_references
- control_flow_in_finally
- diagnostic_describe_all_properties
- empty_statements
- hash_and_equals
- invariant_booleans
- iterable_contains_unrelated_type
- list_remove_unrelated_type
- literal_only_boolean_expressions
- no_adjacent_strings_in_list
- no_duplicate_case_values
- no_logic_in_create_state
- prefer_void_to_null
- test_types_in_equals
- throw_in_finally
- unnecessary_statements
- unrelated_type_equality_checks
- dead_code
- unused_import
- unused_element
- unused_local_variable
# STYLE
- camel_case_types
- library_names
- file_names
- library_prefixes
- non_constant_identifier_names
- constant_identifier_names # prefer
- directives_ordering
- lines_longer_than_80_chars # avoid
- curly_braces_in_flow_control_structures
- use_key_in_widget_constructors
- valid_regexps
- always_declare_return_types
- always_put_control_body_on_new_line
- always_put_required_named_parameters_first
- always_require_non_null_named_parameters
- always_specify_types
- annotate_overrides
- avoid_bool_literals_in_conditional_expressions
- avoid_as
- avoid_catches_without_on_clauses
- avoid_catching_errors
- avoid_classes_with_only_static_members
- avoid_equals_and_hash_code_on_mutable_classes
- avoid_escaping_inner_quotes
- avoid_field_initializers_in_const_classes
- avoid_implementing_value_types
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_positional_boolean_parameters
- avoid_private_typedef_functions
- avoid_redundant_argument_values
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null
- avoid_returning_null_for_void
- avoid_returning_this
- avoid_setters_without_getters
- avoid_shadowing_type_parameters
- avoid_single_cascade_in_expression_statements
- avoid_unnecessary_containers
- avoid_unused_constructor_parameters
- avoid_void_async
- await_only_futures
- camel_case_extensions
- camel_case_types
- cascade_invocations
- cast_nullable_to_non_nullable
- constant_identifier_names
- curly_braces_in_flow_control_structures
- directives_ordering
- empty_catches
- empty_constructor_bodies
- exhaustive_cases
- file_names
- flutter_style_todos
- implementation_imports
- join_return_with_assignment
- library_names
- library_prefixes
- lines_longer_than_80_chars
- missing_whitespace_between_adjacent_strings
- no_runtimeType_toString
- non_constant_identifier_names
- null_check_on_nullable_type_parameter
- null_closures
- one_member_abstracts
- only_throw_errors
- overridden_fields
- prefer_const_constructors_in_immutables
- prefer_const_constructors
- prefer_conditional_assignment
- prefer_asserts_with_message
- package_api_docs
- parameter_assignments
- prefer_adjacent_string_concatenation
- prefer_asserts_in_initializer_lists
- prefer_asserts_with_message
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- prefer_constructors_over_static_methods
- prefer_contains
- prefer_double_quotes
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_final_in_for_each
- prefer_final_locals
- prefer_for_elements_to_map_fromIterable
- 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_is_not_operator
- prefer_iterable_whereType
- prefer_mixin
- prefer_null_aware_operators
- prefer_spread_collections
- prefer_typing_uninitialized_variables
- provide_deprecation_message
- public_member_api_docs
- recursive_getters
- sized_box_for_whitespace
- slash_for_doc_comments
- sort_child_properties_last
- sort_constructors_first
- sort_unnamed_constructors_first
- tighten_type_of_initializing_formals
- type_annotate_public_apis
- type_init_formals
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_lambdas
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_checks
- unnecessary_null_in_if_null_operators
- unnecessary_nullable_for_final_variable_declarations
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_raw_strings
- unnecessary_string_escapes
- unnecessary_string_interpolations
- unnecessary_this
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_is_even_rather_than_modulo
- use_late_for_private_fields_and_variables
- use_raw_strings
- use_rethrow_when_possible
- use_string_buffers
# DOCUMENTATION
- slash_for_doc_comments
- package_api_docs # prefer
- public_member_api_docs # prefer
- comment_references
- invalid_use_of_protected_member
- unawaited_futures
- must_call_super
- unused_field
- use_to_and_as_if_applicable
- void_checks
- sort_pub_dependencies

analyzer:
exclude: [lib/**.g.dart, test/**.g.dart, flutter_test/**.g.dart, build/**]
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors:
slash_for_doc_comments: warning
package_api_docs: error
public_member_api_docs: error
camel_case_types: warning
library_names: error
file_names: error
library_prefixes: warning
non_constant_identifier_names: warning
directives_ordering: warning
lines_longer_than_80_chars: warning
curly_braces_in_flow_control_structures: error
always_require_non_null_named_parameters: error
avoid_renaming_method_parameters: warning
await_only_futures: warning
cascade_invocations: warning
prefer_const_constructors_in_immutables: error
prefer_asserts_in_initializer_lists: warning
prefer_if_elements_to_conditional_expressions: warning
use_to_and_as_if_applicable: warning
one_member_abstracts: warning
prefer_final_fields: warning
avoid_setters_without_getters: error
prefer_generic_function_type_aliases: error
avoid_private_typedef_functions: warning
avoid_positional_boolean_parameters: warning
hash_and_equals: error
avoid_null_checks_in_equality_operators: warning
prefer_interpolation_to_compose_strings: warning
unnecessary_brace_in_string_interps: warning
prefer_iterable_whereType: warning
unnecessary_lambdas: warning
prefer_equal_for_default_values: warning
avoid_init_to_null: warning
unnecessary_this: warning
prefer_initializing_formals: warning
type_init_formals: warning
empty_constructor_bodies: warning
implementation_imports: error
unnecessary_const: warning
avoid_catches_without_on_clauses: warning
use_rethrow_when_possible: warning
dead_code: error
unused_import: error
unused_element: error
unused_local_variable: error
missing_return: error
invalid_use_of_visible_for_testing_member: error
avoid_slow_async_io: warning
invalid_use_of_protected_member: error
unawaited_futures: warning
type_annotate_public_apis: error
must_call_super: error
unused_field: error
unnecessary_overrides: error
# Rules links https://dart-lang.github.io/linter/lints/

0 comments on commit 79295b4

Please sign in to comment.