feat: integrate more lint rules and missing dispose calls (#1174)

* chore: enable additional lint rules and update dependencies

Enable new lint rules including no_equal_then_else, no_equal_conditions,
avoid_contradictory_expressions, and resource cleanup rules. Update
awesome_lints dependency to use local path reference.

* fix: add missing dispose calls for proper resource cleanup

Add dispose() calls for controllers, notifiers, and other resources
across multiple components to prevent memory leaks. Also fix parameter
type in table_node.dart and collection equality check in scroll service.

* refactor: remove deprecated document and node classes

Delete deprecated DocumentV0 and NodeV0 classes and remove the
deprecated Document.empty() factory method in favor of Document.blank().

* fix: remove deprecated exports and duplicate lint ignores

Remove exports for deleted deprecated document and node files from
core.dart and remove duplicate dispose_fields ignore comments.

* chore: point awesome_lints to git main branch

Change awesome_lints dependency from local path to git repository
reference pointing to main branch.

* fix: remove duplicate dispose calls in find replace widget

Remove duplicate findTextEditingController.dispose() call and remove
searchService.dispose() from FindMenu since it doesn't own the service.
The searchService is owned and disposed by the parent widget.

* fix: correct overlay entry disposal in toolbar widgets

Remove overlay entries from overlay before disposing. OverlayEntry must
be removed with remove() before dispose() is called. Move cleanup logic
to proper order in dispose methods.

* refactor: inline overlay cleanup logic in toolbar dispose methods

Replace helper method calls with inline cleanup logic to make the
overlay entry disposal order explicit (remove, dispose, set to null).
This commit is contained in:
Lucas 2025-12-26 17:05:02 +08:00 • committed by GitHub
commit b1e7853608
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,7 +18,21 @@ analyzer:
custom_lint:
enable_all_lint_rules: false
rules:
# Formatting rules
- newline_before_case
- newline_before_constructor
- newline_before_method
- newline_before_return
- no_equal_then_else
- no_equal_conditions
- avoid_contradictory_expressions
- avoid_constant_conditions
- avoid_collection_equality_checks
- avoid_collection_methods_with_unrelated_types
# - avoid_late_context
- avoid_mounted_in_setstate
- proper_super_calls
- dispose_fields
# - avoid_undisposed_instances
# - dispose_class_fields