-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalysis_options.yaml
121 lines (115 loc) · 3.67 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# 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
# analysis_options.yaml
# Lint rules configuration for the project
linter:
rules:
# Import rules
- always_use_package_imports
- avoid_relative_lib_imports
- package_prefixed_library_names
- sort_child_properties_last
- avoid_redundant_argument_values
- always_declare_return_types
- file_names
- use_key_in_widget_constructors
- directives_ordering
# Constructor rules
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
# Null rules
- avoid_catches_without_on_clauses
- avoid_null_checks_in_equality_operators
- avoid_returning_null
- avoid_returning_null_for_void
- avoid_types_on_closure_parameters
- nullable_type_in_catch_clause
- prefer_asserts_in_initializer_lists
- prefer_null_aware_operators
- unnecessary_null_in_if_null_operators
# Unused arguments rules
- avoid_unused_constructor_parameters
- unused_element
- unused_import
- unused_local_variable
- unused_field
- implementation_imports
# Add trailing comma rule
- always_put_required_named_parameters_first
- require_trailing_commas
- always_put_required_positional_parameters_first
- always_require_non_null_named_parameters
- always_require_non_null_positional_parameters
- avoid_annotating_with_dynamic
- avoid_empty_else
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_returning_null
- avoid_return_types_on_setters
- avoid_types_as_parameter_names
- avoid_types_on_closure_parameters
- constant_identifier_names
- empty_catches
- empty_constructor_bodies
- hash_and_equals
- no_duplicate_case_values
- prefer_const_constructors
- prefer_const_declarations
- prefer_final_fields
- prefer_is_empty
- prefer_contains
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- sort_constructors_first
- sort_unnamed_constructors_first
- test_types_in_equals
- unnecessary_const
- unnecessary_lambdas
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_new
- unnecessary_this
- prefer_inlined_adds
- prefer_inlined_calls
- prefer_iterable_whereType
- prefer_iterable_whereType_test
- prefer_single_child_layouts
- prefer_spread_collections
- prefer_void_to_null
- prefer_asserts_with_message
- prefer_trailing_comma_in_collection_literals # Add this rule
- avoid_types_as_parameter_names:
enabled: true
severity: warning
# Specify the strong mode for static analysis
analyzer:
strong-mode: true
exclude:
- some_directory/**
- another_directory/file.dart
errors:
- '*'
# Specify code organization and formatting settings
dart_style:
enabled: true
line_length: 80
indent: 2
uses_tabs: false
always_use_braces: false
allow_single_quotes: true
implicit_cascade_style: never
spaces_around_ranges: true
single_member_annotations: true
space_before_function_call_arguments: false
split_named_parameters: false
wrap_lists: true
wrap_collections: true