Skip to content

Instantly share code, notes, and snippets.

@rohankandwal
Forked from crizant/analysis_options.yaml
Created March 10, 2022 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rohankandwal/c42505ee97a5442d9d89fe3a62f221d2 to your computer and use it in GitHub Desktop.
Save rohankandwal/c42505ee97a5442d9d89fe3a62f221d2 to your computer and use it in GitHub Desktop.
Flutter linting rules
analyzer:
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:
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_empty_else
- avoid_slow_async_io
- avoid_types_as_parameter_names
- avoid_unused_constructor_parameters
- await_only_futures
- camel_case_types
- cancel_subscriptions
- empty_constructor_bodies
- file_names
- library_names
- library_prefixes
- lines_longer_than_80_chars
- list_remove_unrelated_type
- no_duplicate_case_values
- non_constant_identifier_names
- prefer_asserts_in_initializer_lists
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_final_locals
- prefer_foreach
- prefer_initializing_formals
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_single_quotes
- prefer_void_to_null
- recursive_getters
- sort_pub_dependencies
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_statements
- unnecessary_this
- valid_regexps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment