Repository navigation
Expand file tree
/
Copy pathanalysis_options.yaml
More file actions
45 lines (42 loc) · 2.14 KB
/
Copy pathanalysis_options.yaml
File metadata and controls
45 lines (42 loc) · 2.14 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
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
exclude:
# `server/` is a standalone package: it has its own pubspec and imports its
# own code as `package:zero_auth_example_server/...`, which the root package
# config cannot resolve. Analysing it from the repo root therefore reports
# "Target of URI doesn't exist" on every import. It is analysed separately,
# both locally (`cd server && dart analyze`) and in CI (server-check job).
# `server/` 是独立 package:有自己的 pubspec,并以
# `package:zero_auth_example_server/...` 引用自身代码,根包的 package config
# 无法解析该名称,因此在根目录分析会全部报 “Target of URI doesn't exist”。
# 它单独分析:本地用 `cd server && dart analyze`,CI 由 server-check job 负责。
- server/**
# `example/` 同样是独立 package,而且依赖 Flutter SDK 与插件
# (`flutter_secure_storage`, `flutter_test`);根包的 package config 解析不到
# 它们,于是 `example/lib` 与 `example/test` 会在根目录分析时报
# “Target of URI doesn't exist”。它由 CI 的 `flutter analyze lib/ test/`
# 单独覆盖,本地用 `cd example && flutter analyze`。
# `example/` is a standalone Flutter package: its plugin and `flutter_test`
# imports cannot be resolved from the pure-Dart root package config, so
# analysing it here reports “Target of URI doesn't exist”. CI covers it with
# `flutter analyze lib/ test/` instead.
- example/**
linter:
rules:
# Consistent style / readability — only rules that don't require large-scale
# refactors of the existing code base.
- always_declare_return_types
- annotate_overrides
- avoid_empty_else
- avoid_relative_lib_imports
- avoid_returning_this
- avoid_types_on_closure_parameters
- curly_braces_in_flow_control_structures
- prefer_single_quotes
- require_trailing_commas
- unawaited_futures
- use_key_in_widget_constructors
- use_rethrow_when_possible
- void_checks