-
Notifications
You must be signed in to change notification settings - Fork 33
/
analysis_options.yaml
51 lines (44 loc) · 2.08 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
include: package:lints/recommended.yaml
linter:
rules:
# We enable a few additional rules not in the default and recommended sets.
# Those in general have low impact on correct code apart from possibly requiring an additional keyword (like async,
# await, final) or asking you to move a statement to a different line. However many of these linter rules make the
# code either more uniform or avoid bug prone behaviour. For example not awaiting a future usually is a mistake.
# You can always disable a linter warning with a comment like `// ignore: unawaited_futures`. Please add reasoning,
# why you disable the rule in such cases. This helps others understand, that you explicitly want a behaviour, that
# usually would be considered a mistake.
# Performance (or potential bugs)
# Fixing these warnings makes code easier to optimize for the compiler or prevents leaks.
cancel_subscriptions: true
prefer_final_in_for_each: true
prefer_final_locals: true
# Warn about possible bugs
# Usually code with these warnings indicates a bug.
# Please document if your code explicitly wants such a behaviour.
always_declare_return_types: true
discarded_futures: true
no_adjacent_strings_in_list: true
test_types_in_equals: true
throw_in_finally: true
unawaited_futures: true
unnecessary_statements: true
unsafe_html: true
# Readability & Style
# These are opinionated choices, where Dart gives us 2 ways to express the same thing.
# This avoids mental overhead by not having to make a choice and making code more uniform to read.
always_use_package_imports: true
avoid_bool_literals_in_conditional_expressions: true
prefer_single_quotes: true
sort_child_properties_last: true
sort_pub_dependencies: true
require_trailing_commas: true
# Be nice to our users and allow them to configure what gets logged.
avoid_print: true
non_constant_identifier_names: false # seems to wrongly diagnose static const variables
analyzer:
errors:
todo: ignore
exclude:
- example/main.dart
plugins: