AWS Amplify Lints
Lints used throughout Flutter packages and plugins.
Lints
The linter rules in this package are derived from the Dart team's lints package (for Dart packages) and flutter_lints (for Flutter apps/plugins/packages). A link to the description for each of the additional linter rules is provided below. More detail about linter rules can be found on the official linter rules homepage.
Dart/Flutter Libraries (library.yaml
)
Libraries will use the package:lints
"recommended" ruleset plus the following:
- always_declare_return_types
- always_use_package_imports
- avoid_catches_without_on_clauses
- avoid_classes_with_only_static_members
- avoid_dynamic_calls
- avoid_equals_and_hash_code_on_mutable_classes
- avoid_field_initializers_in_const_classes
- avoid_js_rounded_ints
- avoid_multiple_declarations_per_line
- avoid_positional_boolean_parameters
- avoid_print
- avoid_type_to_string
- avoid_unnecessary_containers
- avoid_unused_constructor_parameters
- avoid_void_async
- cancel_subscriptions
- cascade_invocations
- close_sinks
- comment_references
- conditional_uri_does_not_exist
- depend_on_referenced_packages
- deprecated_consistency
- diagnostic_describe_all_properties
- directives_ordering
- eol_at_end_of_file
- flutter_style_todos
- join_return_with_assignment
- lines_longer_than_80_chars
- missing_whitespace_between_adjacent_strings
- no_runtimeType_toString
- noop_primitive_operations
- omit_local_variable_types
- only_throw_errors
- package_api_docs
- prefer_asserts_in_initializer_lists
- prefer_asserts_with_message
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- prefer_final_in_for_each
- prefer_final_locals
- prefer_if_elements_to_conditional_expressions
- prefer_int_literals
- prefer_null_aware_method_calls
- prefer_single_quotes
- public_member_api_docs
- require_trailing_commas
- sized_box_for_whitespace
- sort_child_properties_last
- sort_constructors_first
- sort_unnamed_constructors_first
- sort_pub_dependencies
- tighten_type_of_initializing_formals
- type_annotate_public_apis
- unawaited_futures
- unnecessary_null_checks
- use_enums
- use_if_null_to_convert_nulls_to_bools
- use_late_for_private_fields_and_variables
- use_named_constants
- use_raw_strings
- use_setters_to_change_properties
- use_string_buffers
- use_super_parameters
- use_test_throws_matchers
- use_to_and_as_if_applicable
- unnecessary_await_in_return
- unnecessary_lambdas
- use_full_hex_values_for_flutter_colors
- use_key_in_widget_constructors
Dart/Flutter Apps (app.yaml
)
Dart and Flutter apps will use the flutter_lints
package plus a subset of the linter rules above, namely:
- avoid_catches_without_on_clauses
- avoid_catching_errors
- avoid_dynamic_calls
- avoid_field_initializers_in_const_classes
- cancel_subscriptions
- close_sinks
- directives_ordering
- eol_at_end_of_file
- flutter_style_todos
- omit_local_variable_types
- only_throw_errors
- prefer_final_in_for_each
- prefer_final_locals
- prefer_if_elements_to_conditional_expressions
- prefer_int_literals
- prefer_null_aware_method_calls
- prefer_single_quotes
- require_trailing_commas
- secure_pubspec_urls
- sized_box_shrink_expand
- sort_constructors_first
- sort_pub_dependencies
- tighten_type_of_initializing_formals
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_lambdas
- unnecessary_null_checks
- use_colored_box
- use_decorated_box
- use_enums
- use_if_null_to_convert_nulls_to_bools
- use_late_for_private_fields_and_variables
- use_named_constants
- use_raw_strings
- use_setters_to_change_properties
- use_super_parameters
- use_test_throws_matchers