blob: 8f1017c536c573198a39ad683b5d2396c073aca6 [file] [log] [blame]
# This file contains the analysis options used for code in the webdev
# repository.
include: package:lints/recommended.yaml
analyzer:
exclude:
# Ignore generated files
- "lib/data/*"
# Ignore debug extension builds
- "debug_extension/dev_build/*"
- "debug_extension/prod_build/*"
- "debug_extension_mv3/dev_build/*"
- "debug_extension_mv3/prod_build/*"
linter:
rules:
- always_use_package_imports
- avoid_void_async
- directives_ordering
- prefer_final_locals
- require_trailing_commas
- unawaited_futures
- unnecessary_lambdas
# TODO(https://github.com/dart-lang/webdev/issues/2053): Enable commented-out rules with fixes.
dart_code_metrics:
metrics:
# cyclomatic-complexity: 20 # Enable.
# number-of-parameters: 5 # Enable.
# maximum-nesting-level: 5 # Enable.
metrics-exclude:
- test/**
rules:
# - arguments-ordering
# - avoid-banned-imports
- avoid-cascade-after-if-null
- avoid-collection-methods-with-unrelated-types
# - avoid-double-slash-imports
- avoid-duplicate-exports
# - avoid-dynamic
# - avoid-global-state # Enable.
# - avoid-ignoring-return-values
# - avoid-late-keyword
- avoid-missing-enum-constant-in-map
- avoid-nested-conditional-expressions
- avoid-non-ascii-symbols
# - avoid-non-null-assertion # Enable.
# - avoid-passing-async-when-sync-expected # Enable.
- avoid-redundant-async
# - avoid-throw-in-catch-block # Enable.
# - avoid-top-level-members-in-tests
# - avoid-unnecessary-conditionals
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-unused-parameters
# - ban-name
- binary-expression-operand-order
- double-literal-format
# - format-comment # Enable.
# - list-all-equatable-fields
# - member-ordering # Enable.
# - missing-test-assertion
# - new-line-before-return
- no-boolean-literal-compare
# - no-empty-block # Enable.
# - no-equal-arguments
- no-equal-then-else
# - no-magic-number
# - no-object-declaration
# - prefer-async-await # Enable.
# - prefer-commenting-analyzer-ignores # Enable.
# - prefer-conditional-expressions
# - prefer-correct-identifier-length
# - prefer-correct-test-file-name # Enable.
- prefer-correct-type-name
- prefer-enums-by-name
# - prefer-first
# - prefer-immediate-return # Enable.
- prefer-iterable-of
- prefer-last
# - prefer-match-file-name
# - prefer-moving-to-variable: # Enable.
# allow-duplicated-chains: 2
# - prefer-static-class
# - prefer-trailing-comma
# - tag-name