mirror of
https://github.com/rrousselGit/riverpod.git
synced 2026-03-13 07:41:27 +08:00
115 lines
4.0 KiB
YAML
115 lines
4.0 KiB
YAML
include: all_lint_rules.yaml
|
|
analyzer:
|
|
language:
|
|
strict-casts: true
|
|
strict-inference: true
|
|
strict-raw-types: true
|
|
errors:
|
|
# Otherwise cause the import of all_lint_rules to warn because of some rules conflicts.
|
|
# We explicitly enabled even conflicting rules and are fixing the conflict
|
|
# in this file
|
|
included_file_warning: ignore
|
|
# false positive when using Freezed
|
|
invalid_annotation_target: ignore
|
|
# I prefer specifying a parameter on a widget even if they are unused (such as Key)
|
|
# for the sake of consistency.
|
|
unused_element_parameter: false
|
|
unrecognized_error_code: ignore
|
|
# Remove once we require analyzer 8.0.0
|
|
# We currently support both 7.0 and 8.0, so we can't migrate yet.
|
|
deprecated_member_use: ignore
|
|
# Analyzer API is experimental, but kind of necessary for analyzer plugins
|
|
experimental_member_use: ignore
|
|
|
|
linter:
|
|
rules:
|
|
# No good way to "fix" the diagnostic. Cf https://github.com/dart-lang/sdk/issues/61976
|
|
unsafe_variance: false
|
|
|
|
# Conflicts with having to specify types on public properties
|
|
omit_obvious_property_types: false
|
|
|
|
# Using it on purpose for signaling that an API can be both async and sync
|
|
avoid_futureor_void: false
|
|
|
|
# I hate it
|
|
specify_nonobvious_property_types: false
|
|
specify_nonobvious_local_variable_types: false
|
|
|
|
# Clashes with newer dartfmt
|
|
require_trailing_commas: false
|
|
|
|
# Maybe later. Too many to fix right now.
|
|
document_ignores: false
|
|
|
|
# Not an issue if using dartfmt
|
|
no_adjacent_strings_in_list: false
|
|
|
|
# False positive for custom enum-like classes (such as Flutter's "Colors")
|
|
avoid_classes_with_only_static_members: false
|
|
|
|
# False positive when the future is returned by the function
|
|
discarded_futures: false
|
|
|
|
# Low value and lacks a quick fix
|
|
combinators_ordering: false
|
|
|
|
# Conflicts with unused variables
|
|
no_leading_underscores_for_local_identifiers: false
|
|
|
|
# false positive
|
|
one_member_abstracts: false
|
|
|
|
# too verbose
|
|
prefer_final_parameters: false
|
|
|
|
# Too verbose with little value, and this is taken care of by the Flutter devtool anyway.
|
|
diagnostic_describe_all_properties: false
|
|
|
|
# Personal preference. I prefer "if (bool) return;" over having it in multiple lines
|
|
always_put_control_body_on_new_line: false
|
|
|
|
# Personal preference. I don't find it more readable
|
|
cascade_invocations: false
|
|
|
|
# Conflicts with `prefer_single_quotes`
|
|
# Single quotes are easier to type and don't compromise on readability.
|
|
prefer_double_quotes: false
|
|
|
|
# Conflicts with `omit_local_variable_types` and other rules.
|
|
# As per Dart guidelines, we want to avoid unnecessary types to make the code
|
|
# more readable.
|
|
# See https://dart.dev/guides/language/effective-dart/design#avoid-type-annotating-initialized-local-variables
|
|
always_specify_types: false
|
|
|
|
# Incompatible with `prefer_final_locals`
|
|
# Having immutable local variables makes larger functions more predictable
|
|
# so we will use `prefer_final_locals` instead.
|
|
unnecessary_final: false
|
|
|
|
# Not quite suitable for Flutter, which may have a `build` method with a single
|
|
# return, but that return is still complex enough that a "body" is worth it.
|
|
prefer_expression_function_bodies: false
|
|
|
|
# Conflicts with the convention used by flutter, which puts `Key key`
|
|
# and `@required Widget child` last.
|
|
always_put_required_named_parameters_first: false
|
|
|
|
# This project doesn't use Flutter-style todos
|
|
flutter_style_todos: false
|
|
|
|
# There are situations where we voluntarily want to catch everything,
|
|
# especially as a library.
|
|
avoid_catches_without_on_clauses: false
|
|
|
|
# Boring as it sometimes force a line of 81 characters to be split in two.
|
|
# As long as we try to respect that 80 characters limit, going slightly
|
|
# above is fine.
|
|
lines_longer_than_80_chars: false
|
|
|
|
# Conflicts with disabling `implicit-dynamic`
|
|
avoid_annotating_with_dynamic: false
|
|
|
|
# conflicts with `prefer_relative_imports`
|
|
always_use_package_imports: false
|