|
1 |
| -# Specify analysis options. |
2 |
| -# |
3 |
| -# Until there are meta linter rules, each desired lint must be explicitly enabled. |
4 |
| -# See: https://github.com/dart-lang/linter/issues/288 |
5 |
| -# |
6 |
| -# For a list of lints, see: http://dart-lang.github.io/linter/lints/ |
7 |
| -# See the configuration guide for more |
8 |
| -# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer |
9 |
| -# |
10 |
| -# NOTE: Please keep this file in sync with |
11 |
| -# https://github.com/flutter/flutter/blob/master/analysis_options.yaml |
12 |
| - |
| 1 | +include: package:pedantic/analysis_options.yaml |
13 | 2 | analyzer:
|
14 |
| - language: |
15 |
| - strict-inference: true |
16 |
| - strict-raw-types: true |
17 |
| - strong-mode: |
18 |
| - implicit-dynamic: false |
19 |
| - errors: |
20 |
| - # treat missing required parameters as a warning (not a hint) |
21 |
| - missing_required_param: warning |
22 |
| - # treat missing returns as a warning (not a hint) |
23 |
| - missing_return: warning |
24 |
| - # allow having TODOs in the code |
25 |
| - todo: ignore |
26 | 3 | exclude:
|
27 |
| - - 'bin/cache/**' |
28 |
| - # the following two are relative to the stocks example and the flutter package respectively |
29 |
| - # see https://github.com/dart-lang/sdk/issues/28463 |
30 |
| - - 'lib/i18n/stock_messages_*.dart' |
31 |
| - - 'lib/src/http/**' |
32 |
| - |
| 4 | + # Ignore generated files |
| 5 | + - '**/*.g.dart' |
| 6 | + - 'lib/src/generated/*.dart' |
33 | 7 | linter:
|
34 | 8 | rules:
|
35 |
| - # these rules are documented on and in the same order as |
36 |
| - # the Dart Lint rules page to make maintenance easier |
37 |
| - # http://dart-lang.github.io/linter/lints/ |
38 |
| - |
39 |
| - # === error rules === |
40 |
| - - avoid_empty_else |
41 |
| - - avoid_slow_async_io |
42 |
| - - cancel_subscriptions |
43 |
| - # - close_sinks # https://github.com/flutter/flutter/issues/5789 |
44 |
| - # - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153 |
45 |
| - - control_flow_in_finally |
46 |
| - - empty_statements |
47 |
| - - hash_and_equals |
48 |
| - # - invariant_booleans # https://github.com/flutter/flutter/issues/5790 |
49 |
| - - iterable_contains_unrelated_type |
50 |
| - - list_remove_unrelated_type |
51 |
| - # - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791 |
52 |
| - - no_adjacent_strings_in_list |
53 |
| - - no_duplicate_case_values |
54 |
| - - test_types_in_equals |
55 |
| - - throw_in_finally |
56 |
| - - unrelated_type_equality_checks |
57 |
| - - valid_regexps |
58 |
| - |
59 |
| - # === style rules === |
60 |
| - - always_declare_return_types |
61 |
| - # - always_put_control_body_on_new_line |
62 |
| - - always_require_non_null_named_parameters |
63 |
| - - always_specify_types |
64 |
| - - annotate_overrides |
65 |
| - # - avoid_annotating_with_dynamic # not yet tested |
66 |
| - - avoid_as |
67 |
| - # - avoid_catches_without_on_clauses # not yet tested |
68 |
| - # - avoid_catching_errors # not yet tested |
69 |
| - # - avoid_classes_with_only_static_members # not yet tested |
70 |
| - # - avoid_function_literals_in_foreach_calls # not yet tested |
71 |
| - - avoid_init_to_null |
72 |
| - - avoid_null_checks_in_equality_operators |
73 |
| - # - avoid_positional_boolean_parameters # not yet tested |
74 |
| - - avoid_return_types_on_setters |
75 |
| - # - avoid_returning_null # not yet tested |
76 |
| - # - avoid_returning_this # not yet tested |
77 |
| - # - avoid_setters_without_getters # not yet tested |
78 |
| - # - avoid_types_on_closure_parameters # not yet tested |
79 |
| - - await_only_futures |
80 |
| - - camel_case_types |
81 |
| - # - cascade_invocations # not yet tested |
82 |
| - # - constant_identifier_names # https://github.com/dart-lang/linter/issues/204 |
83 |
| - - directives_ordering |
84 |
| - - empty_catches |
85 |
| - - empty_constructor_bodies |
86 |
| - - implementation_imports |
87 |
| - # - join_return_with_assignment # not yet tested |
88 |
| - - library_names |
89 |
| - - library_prefixes |
90 |
| - - non_constant_identifier_names |
91 |
| - # - omit_local_variable_types # opposite of always_specify_types |
92 |
| - # - one_member_abstracts # too many false positives |
93 |
| - # - only_throw_errors # https://github.com/flutter/flutter/issues/5792 |
94 |
| - - overridden_fields |
95 |
| - - package_api_docs |
96 |
| - - package_prefixed_library_names |
97 |
| - # - parameter_assignments # we do this commonly |
98 |
| - - prefer_adjacent_string_concatenation |
99 |
| - - prefer_collection_literals |
100 |
| - # - prefer_conditional_assignment # not yet tested |
101 |
| - - prefer_const_constructors |
102 |
| - # - prefer_constructors_over_static_methods # not yet tested |
103 |
| - - prefer_contains |
104 |
| - - prefer_equal_for_default_values |
105 |
| - # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods |
106 |
| - # - prefer_final_fields # https://github.com/dart-lang/linter/issues/506 |
107 |
| - - prefer_final_locals |
108 |
| - # - prefer_foreach # not yet tested |
109 |
| - # - prefer_function_declarations_over_variables # not yet tested |
110 |
| - - prefer_initializing_formals |
111 |
| - # - prefer_interpolation_to_compose_strings # not yet tested |
112 |
| - - prefer_is_empty |
113 |
| - - prefer_is_not_empty |
114 |
| - - prefer_void_to_null |
115 |
| - # - recursive_getters # https://github.com/dart-lang/linter/issues/452 |
116 |
| - - slash_for_doc_comments |
117 |
| - - sort_constructors_first |
118 |
| - - sort_unnamed_constructors_first |
119 |
| - # - type_annotate_public_apis # subset of always_specify_types |
120 |
| - - type_init_formals |
121 |
| - # - unawaited_futures # https://github.com/flutter/flutter/issues/5793 |
122 |
| - - unnecessary_brace_in_string_interps |
123 |
| - - unnecessary_const |
124 |
| - - unnecessary_getters_setters |
125 |
| - # - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498 |
126 |
| - - unnecessary_new |
127 |
| - - unnecessary_null_aware_assignments |
128 |
| - - unnecessary_null_in_if_null_operators |
129 |
| - # - unnecessary_overrides # https://github.com/dart-lang/linter/issues/626 and https://github.com/dart-lang/linter/issues/627 |
130 |
| - - unnecessary_statements |
131 |
| - - unnecessary_this |
132 |
| - - use_rethrow_when_possible |
133 |
| - # - use_setters_to_change_properties # not yet tested |
134 |
| - # - use_string_buffers # https://github.com/dart-lang/linter/pull/664 |
135 |
| - # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review |
136 |
| - |
137 |
| - # === pub rules === |
138 |
| - - package_names |
| 9 | + - public_member_api_docs |
0 commit comments