-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalysis_options.yaml
114 lines (110 loc) · 8.22 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
# 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
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
always_use_package_imports: true # Avoid relative imports for files in lib/.
avoid_print: true # Avoid print calls in production code.
avoid_empty_else: true # Avoid empty else statements.
empty_statements: true # Avoid empty statements.
iterable_contains_unrelated_type: true # Invocation of Iterable.contains with references of unrelated types.
list_remove_unrelated_type: true # Invocation of remove with references of unrelated types.
no_duplicate_case_values: true # Don't use more than one case with same value.
no_logic_in_create_state: true # Don't put any logic in createState.
unrelated_type_equality_checks: true # Equality operator == invocation with references of unrelated types.
use_key_in_widget_constructors: true # Use key in widget constructors.
valid_regexps: true # Use valid regular expression syntax.
always_put_required_named_parameters_first: false # Put required named parameters first.
always_require_non_null_named_parameters: true # Specify @required on named parameters without defaults
avoid_bool_literals_in_conditional_expressions: true # Avoid bool literals in conditional expressions.
avoid_catches_without_on_clauses: true # Avoid catches without on clauses.
avoid_field_initializers_in_const_classes: true # Avoid field initializers in const classes.
avoid_types_on_closure_parameters: false # Avoid annotating types for function expression parameters.
avoid_unused_constructor_parameters: true # Avoid defining unused parameters in constructors.
camel_case_extensions: true # Name extensions using UpperCamelCase.
camel_case_types: true # Name types using UpperCamelCase.
cascade_invocations: false # Cascade consecutive method invocations on the same reference.
constant_identifier_names: false # Prefer using lowerCamelCase for constant names
curly_braces_in_flow_control_structures: true # DO use curly braces for all flow control structures.
deprecated_consistency: true # Missing deprecated annotation.
directives_ordering: true # Adhere to Effective Dart Guide directives sorting conventions.
empty_catches: true # Avoid empty catch blocks.
empty_constructor_bodies: true # Use ; instead of {} for empty constructor bodies.
exhaustive_cases: true # Define case clauses for all constants in enum-like classes.
file_names: true # Name source files using lowercase_with_underscores.
implementation_imports: true # Don't import implementation files from another package.
leading_newlines_in_multiline_strings: true # Start multiline strings with a newline.
lines_longer_than_80_chars: false # Avoid lines longer than 80 characters.
null_check_on_nullable_type_parameter: true # Don't use null check on a potentially nullable type parameter.
null_closures: true # Do not pass null as an argument where a closure is expected.
only_throw_errors: true # Only throw instances of classes extending either Exception or Error.
package_api_docs: false # Provide doc comments for all public APIs.
parameter_assignments: true # Don't reassign references to parameters of functions or methods.
prefer_adjacent_string_concatenation: true # Use adjacent strings to concatenate string literals.
prefer_asserts_in_initializer_lists: true # Prefer putting asserts in initializer list.
prefer_asserts_with_message: true # Prefer asserts with message.
prefer_const_constructors: true # Prefer const with constant constructors.
prefer_const_constructors_in_immutables: true # Prefer declaring const constructors on @immutable classes.
prefer_contains: true # Use contains for List and String instances.
prefer_single_quotes: false # Only use double quotes for strings containing single quotes.
prefer_double_quotes: false # Prefer double quotes where they won't require escape sequences.
prefer_equal_for_default_values: true # Use = to separate a named parameter from its default value.
prefer_final_fields: true # Private field could be final.
prefer_final_in_for_each: true # Prefer final in for-each loop variable if reference is not reassigned.
prefer_final_locals: true # Prefer final for variable declarations if they are not reassigned.
prefer_if_null_operators: true # Prefer using if null operators.
prefer_interpolation_to_compose_strings: true # Use interpolation to compose strings and values.
prefer_is_empty: true # Use isEmpty for Iterables and Maps.
prefer_is_not_empty: true # Use isNotEmpty for Iterables and Maps.
prefer_iterable_whereType: true # Prefer to use whereType on iterable.
prefer_null_aware_operators: true # Prefer using null aware operators.
prefer_null_aware_method_calls: true # Prefer null aware method calls.
prefer_spread_collections: true # Use spread collections when possible.
prefer_typing_uninitialized_variables: true # Prefer typing uninitialized variables and fields.
public_member_api_docs: false # Document all public members.
require_trailing_commas: false # Use trailing commas for all function calls and declarations.
sized_box_for_whitespace: false # SizedBox for whitespace.
slash_for_doc_comments: true # Prefer using /// for doc comments.
sort_child_properties_last: true # Sort child properties last in widget instance creations.
sort_constructors_first: true # Sort constructor declarations before other members.
sort_unnamed_constructors_first: true # Sort unnamed constructor declarations first.
tighten_type_of_initializing_formals: true # Tighten type of initializing formal.
type_annotate_public_apis: false # Type annotate public APIs.
unawaited_futures: true # Future results in async function bodies must be awaited or marked unawaited using package:pedantic.
unnecessary_await_in_return: true # Unnecessary await keyword in return.
unnecessary_brace_in_string_interps: true # Avoid using braces in interpolation when not needed.
unnecessary_constructor_name: true # Unnecessary .new constructor name.
unnecessary_new: true # Unnecessary new keyword.
unnecessary_null_aware_assignments: true # Avoid null in null-aware assignment.
unnecessary_null_in_if_null_operators: true # Avoid using null in if null operators.
unnecessary_overrides: true # Don't override a method to do a super method invocation with the same parameters.
unnecessary_parenthesis: true # Unnecessary parenthesis can be removed.
unnecessary_raw_strings: true # Unnecessary raw string.
unnecessary_string_escapes: true # Remove unnecessary backslashes in strings.
unnecessary_string_interpolations: true # Unnecessary string interpolation.
unnecessary_this: true # Don't access members with this unless avoiding shadowing.
use_full_hex_values_for_flutter_colors: true # Prefer an 8-digit hexadecimal integer(0xFFFFFFFF) to instantiate Color.
use_if_null_to_convert_nulls_to_bools: true # Use if-null operators to convert nulls to bools.
use_raw_strings: true # Use raw string to avoid escapes.
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
plugins:
- custom_lint