blob: 75dfb966882e399efdc6928eef043d135e891300 [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/tools/analysis.
include: package:lints/recommended.yaml
analyzer:
language:
strict-casts: true
strict-inference: true
linter:
rules:
# consistency
- combinators_ordering
- directives_ordering
- library_annotations
- lines_longer_than_80_chars
- omit_local_variable_types
- prefer_asserts_in_initializer_lists
- prefer_const_constructors
- prefer_relative_imports
- prefer_single_quotes
- sort_pub_dependencies
- unnecessary_lambdas
- unnecessary_library_directive
- unnecessary_parenthesis
- unnecessary_statements
- use_is_even_rather_than_modulo
# correctness
- always_declare_return_types
- avoid_catching_errors
- avoid_dynamic_calls
- comment_references
- conditional_uri_does_not_exist
- only_throw_errors
- test_types_in_equals
- throw_in_finally
- type_annotate_public_apis
- unawaited_futures
- unreachable_from_main