Enable additional DCM lints (PR 1 of many) - #9943
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds several new lint rules to analysis_options.yaml and updates the codebase to comply with them. This includes wrapping asynchronous calls in unawaited, adding ignore comments for intentional async calls in sync functions, simplifying nested if statements, and replacing assert(false) statements with exceptions in debug mode. The review feedback identifies a critical logical bug in extent_delegate_list.dart where refactoring an if-else block accidentally nested a call inside the else block and bypassed a null check. Additionally, the reviewer suggests using more specific Dart error types (such as StateError, ArgumentError, and UnsupportedError) instead of the generic Exception class when replacing the assert(false) statements.
Enable first set of additional DCM lints. More to come. Work towards #9939.
Enables the following rules and fixes (or ignores) violations: