Skip to content

Instantly share code, notes, and snippets.

@popeyelau
Last active March 19, 2020 05:23
Show Gist options
  • Save popeyelau/adc420f5c93da31b9b00f35f0e25fc67 to your computer and use it in GitHub Desktop.
Save popeyelau/adc420f5c93da31b9b00f35f0e25fc67 to your computer and use it in GitHub Desktop.
Dart/Flutter analysis options file.|-|{"files":{"analysis_options.yaml":{"env":"plain"}},"tag":"Gists"}
# https://dart.dev/guides/language/analysis-options
include: package:pedantic/analysis_options.yaml
#include: package:effective_dart/analysis_options.yaml
analyzer:
exclude:
- 'example/**'
- 'build/**'
- '**.g.dart'
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors:
todo: info
unsafe_html: warning
avoid_relative_lib_imports: error
avoid_slow_async_io: error
avoid_types_as_parameter_names: error
cancel_subscriptions: error
close_sinks: error
valid_regexps: error
no_logic_in_create_state: warning
# https://dart-lang.github.io/linter/lints/
linter:
rules:
#false
public_member_api_docs: false # Only for package
avoid_types_on_closure_parameters: false # Not as redundant as helpful and speaking
omit_local_variable_types: false
prefer_relative_imports: false
lines_longer_than_80_chars: false
# true
valid_regexps: true
use_key_in_widget_constructors: true
unrelated_type_equality_checks: true
no_logic_in_create_state: true
no_duplicate_case_values: true
unnecessary_lambdas: true
prefer_if_null_operators: true
prefer_initializing_formals: true
type_annotate_public_apis: true
avoid_equals_and_hash_code_on_mutable_classes: true
prefer_mixin: true
unnecessary_const: true
avoid_shadowing_type_parameters: true
prefer_final_fields: true
prefer_final_in_for_each: true
avoid_relative_lib_imports: true
avoid_print: true
unsafe_html: true
avoid_slow_async_io: true
avoid_types_as_parameter_names: true
prefer_void_to_null: true
avoid_empty_else: true
unnecessary_new: true
unnecessary_this: true
prefer_const_declarations: true
prefer_const_constructors: true
await_only_futures: true
avoid_void_async: true
camel_case_types: true
cancel_subscriptions: true
close_sinks: true
constant_identifier_names: true
control_flow_in_finally: true
empty_statements: true
hash_and_equals: true
implementation_imports: true
non_constant_identifier_names: true
package_api_docs: true
package_names: true
package_prefixed_library_names: true
test_types_in_equals: true
throw_in_finally: true
unnecessary_brace_in_string_interps: true
unnecessary_getters_setters: true
unnecessary_statements: true
directives_ordering: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment