-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysis_options.yaml
More file actions
98 lines (95 loc) · 3.31 KB
/
analysis_options.yaml
File metadata and controls
98 lines (95 loc) · 3.31 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Static analysis configuration for FlutterSync.
#
# Inherits from `flutter_lints` (latest) and tightens the rules that matter
# for a production-grade sync engine: no implicit casts, no implicit dynamic,
# strict raw types, and explicit handling of every async future.
include: package:flutter_lints/flutter.yaml
analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
errors:
# Promote these to errors so CI fails fast.
todo: error
fixme: error
missing_required_param: error
missing_return: error
invalid_assignment: error
unused_import: error
unused_local_variable: error
dead_code: error
avoid_relative_lib_imports: error
unawaited_futures: error
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
- "**/*.mocks.dart"
- "**/generated/**"
- "build/**"
linter:
rules:
# Style and consistency.
always_declare_return_types: true
always_put_required_named_parameters_first: true
avoid_dynamic_calls: true
avoid_empty_else: true
avoid_print: true
avoid_relative_lib_imports: true
avoid_slow_async_io: true
avoid_type_to_string: true
avoid_types_as_parameter_names: true
avoid_unnecessary_containers: true
avoid_unused_constructor_parameters: true
avoid_void_async: true
cancel_subscriptions: true
# `close_sinks` is disabled: the lint cannot follow StreamControllers
# stored in a Map<String, StreamController<T>> and closed in `dispose()`
# via iteration. Every owner closes its controllers; revisit when the
# store layer is refactored to a more lint-friendly ownership pattern.
close_sinks: false
# `comment_references` is disabled: many adapter doc comments reference
# symbols from peer files that are not imported (and shouldn't be —
# they would create cyclic imports). The references read clearly in
# generated DartDoc; the lint produces noise without value here.
comment_references: false
constant_identifier_names: true
directives_ordering: true
discarded_futures: true
file_names: true
flutter_style_todos: false
no_adjacent_strings_in_list: true
no_runtimeType_toString: true
null_check_on_nullable_type_parameter: true
only_throw_errors: true
prefer_const_constructors: true
prefer_const_constructors_in_immutables: true
prefer_const_declarations: true
prefer_const_literals_to_create_immutables: true
prefer_final_fields: true
prefer_final_in_for_each: true
prefer_final_locals: true
prefer_relative_imports: false
prefer_single_quotes: true
public_member_api_docs: true
require_trailing_commas: true
sort_constructors_first: true
sort_pub_dependencies: false
sort_unnamed_constructors_first: true
test_types_in_equals: true
throw_in_finally: true
type_annotate_public_apis: true
unawaited_futures: true
unnecessary_await_in_return: true
unnecessary_breaks: true
unnecessary_lambdas: true
unnecessary_null_aware_assignments: true
unnecessary_parenthesis: true
unnecessary_statements: true
unnecessary_string_interpolations: true
use_build_context_synchronously: true
use_decorated_box: true
use_enums: true
use_late_for_private_fields_and_variables: false
use_named_constants: true
use_string_buffers: true