|
| 1 | +# Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file |
| 2 | +# for details. All rights reserved. Use of this source code is governed by a |
| 3 | +# BSD-style license that can be found in the LICENSE file. |
| 4 | + |
| 5 | +include: package:lints/recommended.yaml |
| 6 | + |
| 7 | +analyzer: |
| 8 | +# language: |
| 9 | +# strict-casts: true |
| 10 | + errors: |
| 11 | + dead_code: error |
| 12 | + unused_element: error |
| 13 | + unused_import: error |
| 14 | + unused_local_variable: error |
| 15 | + |
| 16 | +linter: |
| 17 | + rules: |
| 18 | + - always_declare_return_types |
| 19 | + - avoid_classes_with_only_static_members |
| 20 | + - avoid_returning_this |
| 21 | + - avoid_unused_constructor_parameters |
| 22 | + - avoid_void_async |
| 23 | + - cancel_subscriptions |
| 24 | + - directives_ordering |
| 25 | + - join_return_with_assignment |
| 26 | + - library_names |
| 27 | + - literal_only_boolean_expressions |
| 28 | + - package_api_docs |
| 29 | + - package_prefixed_library_names |
| 30 | + # - prefer_final_locals |
| 31 | + # - prefer_relative_imports |
| 32 | + - prefer_single_quotes |
| 33 | + - prefer_void_to_null |
| 34 | + - test_types_in_equals |
| 35 | + - throw_in_finally |
| 36 | + - omit_local_variable_types |
| 37 | + - only_throw_errors |
| 38 | + - unawaited_futures |
| 39 | + - unnecessary_lambdas |
| 40 | + - unnecessary_parenthesis |
| 41 | + - unnecessary_statements |
| 42 | + |
| 43 | +# TODO(https://github.com/dart-lang/webdev/issues/2053): Enable commented-out rules with fixes. |
| 44 | +dart_code_metrics: |
| 45 | + metrics: |
| 46 | + # cyclomatic-complexity: 20 # Enable. |
| 47 | + # number-of-parameters: 5 # Enable. |
| 48 | + # maximum-nesting-level: 5 # Enable. |
| 49 | + metrics-exclude: |
| 50 | + - test/** |
| 51 | + rules: |
| 52 | + # - arguments-ordering |
| 53 | + # - avoid-banned-imports |
| 54 | + - avoid-cascade-after-if-null |
| 55 | + - avoid-collection-methods-with-unrelated-types |
| 56 | + # - avoid-double-slash-imports |
| 57 | + - avoid-duplicate-exports |
| 58 | + # - avoid-dynamic |
| 59 | + # - avoid-global-state # Enable. |
| 60 | + # - avoid-ignoring-return-values |
| 61 | + # - avoid-late-keyword |
| 62 | + - avoid-missing-enum-constant-in-map |
| 63 | + - avoid-nested-conditional-expressions |
| 64 | + - avoid-non-ascii-symbols |
| 65 | + # - avoid-non-null-assertion # Enable. |
| 66 | + # - avoid-passing-async-when-sync-expected # Enable. |
| 67 | + - avoid-redundant-async |
| 68 | + # - avoid-throw-in-catch-block # Enable. |
| 69 | + # - avoid-top-level-members-in-tests |
| 70 | + # - avoid-unnecessary-conditionals |
| 71 | + - avoid-unnecessary-type-assertions |
| 72 | + - avoid-unnecessary-type-casts |
| 73 | + - avoid-unrelated-type-assertions |
| 74 | + - avoid-unused-parameters |
| 75 | + # - ban-name |
| 76 | + - binary-expression-operand-order |
| 77 | + - double-literal-format |
| 78 | + # - format-comment # Enable. |
| 79 | + # - list-all-equatable-fields |
| 80 | + # - member-ordering # Enable. |
| 81 | + # - missing-test-assertion |
| 82 | + # - new-line-before-return |
| 83 | + - no-boolean-literal-compare |
| 84 | + # - no-empty-block # Enable. |
| 85 | + # - no-equal-arguments |
| 86 | + - no-equal-then-else |
| 87 | + # - no-magic-number |
| 88 | + # - no-object-declaration |
| 89 | + # - prefer-async-await # Enable. |
| 90 | + # - prefer-commenting-analyzer-ignores # Enable. |
| 91 | + # - prefer-conditional-expressions |
| 92 | + # - prefer-correct-identifier-length |
| 93 | + # - prefer-correct-test-file-name # Enable. |
| 94 | + - prefer-correct-type-name |
| 95 | + - prefer-enums-by-name |
| 96 | + # - prefer-first |
| 97 | + # - prefer-immediate-return # Enable. |
| 98 | + - prefer-iterable-of |
| 99 | + - prefer-last |
| 100 | + # - prefer-match-file-name |
| 101 | + # - prefer-moving-to-variable: # Enable. |
| 102 | + # allow-duplicated-chains: 2 |
| 103 | + # - prefer-static-class |
| 104 | + # - prefer-trailing-comma |
| 105 | + # - tag-name |
0 commit comments