-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalysis_options.yaml
53 lines (50 loc) · 1.61 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
include: package:lints/recommended.yaml
analyzer:
language:
strict-casts: true
strict-raw-types: true
errors:
# Treat most warnings as errors, but allow TODOs as warnings
todo: warning
dead_code: error
# Ignore specific errors if necessary, with justification
# invalid_annotation_target: ignore
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart" # Keep this exclusion even if not using freezed directly, in case dependencies do
plugins:
# Enable dart_code_metrics if added as a dev dependency later
# - dart_code_metrics
linter:
rules:
# Enable additional strict rules from effective_dart, flutter_lints, etc.
# Example: prefer_final_locals, prefer_const_constructors
- prefer_final_locals
- prefer_const_constructors
- avoid_dynamic_calls
- avoid_returning_null_for_future
- require_trailing_commas
# Add more preferred rules here
# dart_code_metrics configuration can be added here if the plugin is enabled
# dart_code_metrics:
# anti-patterns:
# - long-method
# - long-parameter-list
# metrics:
# cyclomatic-complexity: 10
# maximum-nesting-level: 3
# number-of-parameters: 4
# source-lines-of-code: 50 # Per function/method
# metrics-exclude:
# - test/**
# rules:
# # Core rules
# - avoid-global-state
# - avoid-unused-parameters
# # - avoid-non-null-assertion # Generally avoid '!', allow exceptions with justification
# - prefer-trailing-comma
# - prefer-conditional-expressions
# - no-boolean-literal-compare
# - no-empty-block
# - no-magic-number
# # Add more rules as needed