blob: db88c26521c9dc8b5e19b287efc33099a57e0973 [file] [log] [blame]
# Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# This set of lints builds on top of `package:lints/recommended.yaml`; it's
# used by the Dart and Flutter teams when analyzing their packages and
# repositories.
#
# This package is not meant to be a recommendation for analysis settings for
# the wider ecosystem. For our community recommendations, see `package:lints`
# and `package:flutter_lints`.
#
# For documentation about customizing static analysis for your project, see
# https://dart.dev/guides/language/analysis-options.
include: package:lints/recommended.yaml
analyzer:
language:
strict-casts: true
linter:
rules:
# consistency
- avoid_empty_else
- avoid_shadowing_type_parameters
- avoid_types_as_parameter_names
- camel_case_extensions
- curly_braces_in_flow_control_structures
- directives_ordering
- empty_catches
- file_names
- lines_longer_than_80_chars
- omit_local_variable_types
- prefer_asserts_in_initializer_lists
- prefer_generic_function_type_aliases
- prefer_is_empty
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- sort_pub_dependencies
- unnecessary_lambdas
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_statements
- use_is_even_rather_than_modulo
# correctness
- always_declare_return_types
- avoid_catching_errors
- avoid_dynamic_calls
- await_only_futures
- hash_and_equals
- no_duplicate_case_values
- only_throw_errors
- throw_in_finally
- type_annotate_public_apis
- unawaited_futures
- unrelated_type_equality_checks