Skip to content

Commit b1e7853

Browse files
authored
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).
1 parent f882d95 commit b1e7853

File tree

21 files changed

+98
-507
lines changed

21 files changed

+98
-507
lines changed

analysis_options.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,21 @@ analyzer:
1818
custom_lint:
1919
enable_all_lint_rules: false
2020
rules:
21+
# Formatting rules
2122
- newline_before_case
2223
- newline_before_constructor
2324
- newline_before_method
2425
- newline_before_return
26+
27+
- no_equal_then_else
28+
- no_equal_conditions
29+
- avoid_contradictory_expressions
30+
- avoid_constant_conditions
31+
- avoid_collection_equality_checks
32+
- avoid_collection_methods_with_unrelated_types
33+
# - avoid_late_context
34+
- avoid_mounted_in_setstate
35+
- proper_super_calls
36+
- dispose_fields
37+
# - avoid_undisposed_instances
38+
# - dispose_class_fields

lib/src/core/core.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
export 'document/attributes.dart';
2-
export 'document/deprecated/document.dart';
3-
export 'document/deprecated/node.dart';
42
export 'document/diff.dart';
53
export 'document/document.dart';
64
export 'document/node.dart';

lib/src/core/document/deprecated/document.dart

Lines changed: 0 additions & 145 deletions
This file was deleted.

0 commit comments

Comments
 (0)