-
-
Notifications
You must be signed in to change notification settings - Fork 891
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Avoid nested conditional expressions whenever possible [DCM] (
#2784) I was playing around with the rule avoid-nested-conditional-expressions. While I philosophically agree with the rule, sadly Dart's new switch-as-an-expression, while a much-needed improvement, still pales in comparison to Kotlin's powerful when, which makes it impossible to convert all cases of nested ternaries into something actually better. In some cases, given the tools that Dart provides, I think nested ternary is the best option. Notwithstanding, I used the rule to catch many cases where the new switch expression can be used to vastly simplify our codebase, making it much more readable.
- Loading branch information
1 parent
71f7b47
commit 7b6a571
Showing
5 changed files
with
45 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters