Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 59 additions & 4 deletions project/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,69 @@
# TODO: Add flutter_lints to your pubspec.yaml file
include: package:flutter_lints/flutter.yaml

analyzer:
plugins:
- dart_code_metrics

strong-mode:
implicit-casts: false
implicit-dynamic: false
exclude:
- "lib/**/*.freezed.dart"
- "bin/cache/**"
- "lib/util/localization/initialize_i18n/**"
- "lib/assets.dart"
- "lib/**/*.g.dart"
- "lib/**/*.gen.dart"
- "lib/**/*.freezed.dart"
- "test/**"

# TODO: Add dart_code_metrics to your pubspec.yaml file
dart_code_metrics:
anti-patterns:
- long-method
- long-parameter-list
metrics:
cyclomatic-complexity: 20
maximum-nesting-level: 5
number-of-methods: 10
technical-debt:
threshold: 0
todo-cost: 6
ignore-cost: 6
ignore-for-file-cost: 16
as-dynamic-cost: 6
deprecated-annotations-cost: 16
file-nullsafety-migration-cost: 8
unit-type: "Hours"

linter:
rules:
- prefer_single_quotes
- avoid-collection-methods-with-unrelated-types
- avoid-global-state
- avoid-nested-conditional-expressions
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unused-parameters
- ban-name:
severity: warning
entries:
# If using loggy then don't use print
- ident: print
description: Use Loggy for printing statements to the console in this project
# Common look oversights
- ident: Theme.of
description: Use Look for styling in this project
- ident: TextStyle
description: Use Look for styling in this project
- ident: Colors
description: Use Look for styling in this project
- no-boolean-literal-compare
- no-empty-block
- no-equal-then-else
- prefer-immediate-return
- prefer-match-file-name:
severity: style
# Flutter
- always-remove-listener
- avoid-returning-widgets
- prefer-extracting-callbacks
- prefer-single-widget-per-file:
ignore-private-widgets: true