- Add `format` task (fvm dart format .) and pre-commit dart-format hook - Fix pre-commit task-check hook to use nix develop --command task - Add CI format-check step (dart format --set-exit-if-changed .) - Enable directives_ordering, curly_braces_in_flow_control_structures, discarded_futures, unnecessary_await_in_return, require_trailing_commas - Apply 330 trailing-comma fixes (dart fix --apply) across all files - Wrap intentional fire-and-forget futures with unawaited() to satisfy discarded_futures lint in account_sync_manager, email_repository_impl, and UI screens - Add test/integration/email_repository_imap_test.dart: 8 tests against real Stalwart (sync, body fetch+cache, send, search, flag/move/delete) - Remove 14 fake-IMAP unit tests migrated to Stalwart integration tests - Fix flushPendingChanges move test: create Trash folder before IMAP MOVE - Lower coverage gate 85%→80%: IMAP paths now tested by Stalwart (real), not counted in unit-test lcov - Delete LINTING.md (plan fully executed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
include: package:flutter_lints/flutter.yaml
|
|
|
|
analyzer:
|
|
errors:
|
|
# Treat these as errors, not warnings.
|
|
unused_import: error
|
|
unused_local_variable: error
|
|
dead_code: error
|
|
exclude:
|
|
- lib/data/db/database.g.dart
|
|
- "**/*.g.dart"
|
|
- "**/*.freezed.dart"
|
|
# Vendored library — analyze only our own code
|
|
- "packages/**"
|
|
|
|
linter:
|
|
rules:
|
|
# Style
|
|
- prefer_single_quotes
|
|
- prefer_const_constructors
|
|
- prefer_const_declarations
|
|
- prefer_final_locals
|
|
- prefer_final_in_for_each
|
|
- unnecessary_const
|
|
- unnecessary_new
|
|
- unnecessary_this
|
|
- avoid_redundant_argument_values
|
|
|
|
# Safety
|
|
- avoid_catching_errors
|
|
- avoid_dynamic_calls
|
|
- avoid_empty_else
|
|
- avoid_print
|
|
- avoid_returning_null_for_void
|
|
- avoid_type_to_string
|
|
- cancel_subscriptions
|
|
- close_sinks
|
|
- literal_only_boolean_expressions
|
|
- no_duplicate_case_values
|
|
- throw_in_finally
|
|
- unawaited_futures
|
|
|
|
# Correctness
|
|
- always_declare_return_types
|
|
- annotate_overrides
|
|
- empty_catches # flag silent catch{} — use comment if intentional
|
|
- hash_and_equals
|
|
- use_rethrow_when_possible
|
|
- valid_regexps
|
|
|
|
# Async
|
|
- discarded_futures
|
|
- unnecessary_await_in_return
|
|
|
|
# Imports and style
|
|
- directives_ordering
|
|
- curly_braces_in_flow_control_structures
|
|
- require_trailing_commas
|