dart-code-metrics
dart-code-metrics copied to clipboard
[Rule change] `avoid-unrelated-type-assertions` should work with `is!`
What rule do you want to change?
avoid-unrelated-type-assertions
How will the change be implemented? (New option, new default behavior, etc.)?
New behavior: it should trigger warning on is! operator.
Please provide some example code that this change will affect:
From the current rule example:
final result3 = animal is! NotAnimal; // LINT
What does the rule currently do for this code?
No lint warning triggered.
What will the rule do after it's changed?
Lint warning triggered.
Are you willing to submit a pull request to implement this change?
Not sure.
@ookami-kb what do you think if instead of modifying the avoid-unrelated-type-assertions rule, the change will be applied to avoid-unnecessary-type-assertions?
Available in 4.18.0 🚀