Files
xianyan/analysis_options.yaml
Developer 41a60b0288 feat: 新增多项核心服务与功能增强
refactor(theme): 扩展AppTheme支持卡片样式和圆角风格动态配置
feat(services): 新增HapticService触觉反馈服务
feat(services): 实现ScreenWakeService屏幕常亮管理
feat(services): 添加SoundService音效播放服务
feat(services): 集成AppLockService应用锁功能
feat(services): 实现BatteryOptimizationService电池优化
feat(services): 新增NetworkProxyService网络代理
feat(services): 完善DataExportService数据导出
feat(services): 增强PermissionService权限管理
feat(tools): 工具中心新增拼音转换等多项功能
fix(localization): 修复时区初始化错误
docs: 更新工具中心开发清单和设置重构文档
chore: 更新依赖版本和CI配置
2026-05-07 09:05:35 +08:00

96 lines
2.7 KiB
YAML

# ============================================================
# 闲言APP — 代码分析配置
# 创建时间: 2026-04-20
# 更新时间: 2026-04-20
# 作用: Dart/Flutter 静态分析规则
# 上次更新: Phase 0 配置
# ============================================================
# include: package:riverpod_lint/analysis_options.yaml
# 暂时注释掉,待 riverpod_lint 正确安装后再启用
analyzer:
# 排除生成的代码
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
- "**/*.config.dart"
- "lib/gen/**"
- "packages/**"
- "docs/**"
- "docs/toolsapi/**"
- "**/*.md"
- "Scripts/**"
plugins:
- custom_lint
errors:
# 自由化代码的警告降级
invalid_annotation_target: ignore
# 未使用的导入视为警告
unused_import: warning
# 缺少返回类型
missing_return: error
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
linter:
rules:
# ---- 代码风格 ----
prefer_single_quotes: true
prefer_const_constructors: true
prefer_const_declarations: true
prefer_const_literals_to_create_immutables: true
prefer_final_fields: true
prefer_final_locals: true
prefer_final_in_for_each: true
# ---- 命名 ----
camel_case_types: true
camel_case_extensions: true
non_constant_identifier_names: true
constant_identifier_names: true
file_names: true
# ---- 代码质量 ----
avoid_print: true
avoid_empty_else: true
avoid_unnecessary_containers: true
avoid_redundant_argument_values: true
avoid_return_types_on_setters: true
avoid_types_as_parameter_names: true
empty_constructor_bodies: true
empty_catches: true
no_duplicate_case_values: true
no_leading_underscores_for_local_identifiers: true
null_check_on_nullable_type_parameter: true
prefer_is_empty: true
prefer_is_not_empty: true
prefer_is_not_operator: true
prefer_null_aware_operators: true
prefer_typing_uninitialized_variables: true
unnecessary_const: true
unnecessary_new: true
unnecessary_null_in_if_null_operators: true
unnecessary_overrides: true
unnecessary_parenthesis: true
unnecessary_string_escapes: true
unnecessary_string_interpolations: true
unnecessary_this: true
use_key_in_widget_constructors: true
sized_box_for_whitespace: true
use_build_context_synchronously: true
avoid_dynamic_calls: true
# ---- Flutter 特定 ----
use_full_hex_values_for_flutter_colors: true
prefer_void_to_null: true
# ---- 允许的例外 ----
# 代码行宽不严格限制 (依赖 formatter)
# lines_longer_than_80_chars: false