-
Notifications
You must be signed in to change notification settings - Fork 1
/
analysis_options.yaml
80 lines (71 loc) · 1.99 KB
/
analysis_options.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
analyzer:
plugins:
- dart_code_metrics
strong-mode:
implicit-casts: false
implicit-dynamic: false
language:
strict-casts: true
strict-inference: true
exclude:
- lib/**/*.g.dart
- lib/**/*.freezed.dart
errors:
todo: ignore
linter:
rules:
- always_declare_return_types
- cancel_subscriptions
- close_sinks
- comment_references
- depend_on_referenced_packages
- library_private_types_in_public_api
- one_member_abstracts
- only_throw_errors
- no_leading_underscores_for_library_prefixes
dart_code_metrics:
anti-patterns:
- long-method
- long-parameter-list
metrics:
cyclomatic-complexity: 20
maximum-nesting-level: 5
number-of-parameters: 4
source-lines-of-code: 50
metrics-exclude:
- test/**
rules:
- avoid-dynamic
- avoid-global-state
- avoid-unused-parameters
- newline-before-return
- no-boolean-literal-compare
- no-empty-block
- prefer-trailing-comma
- prefer-conditional-expressions
- no-equal-then-else
- no-magic-number
- no-object-declaration
- member-ordering:
order:
- constructors
- public-fields
- private-fields
# Flutter specific
- avoid-border-all
- always-remove-listener
- avoid-returning-widgets
- avoid-unnecessary-setstate
- avoid-wrapping-in-padding
- prefer-const-border-radius
- prefer-extracting-callbacks
- prefer-single-widget-per-file