dart-code-metrics
dart-code-metrics copied to clipboard
[New rule] prefer-abstract-field
Please describe what the rule should do:
abstract class A {
double get a;
set a(double value);
}
can be written as following:
abstract class A {
abstract double a;
}
The linter should warn for the first case (so users can write the second case)
If your rule is inspired by other please provide link to it:
What category of rule is this? (place an "X" next to just one item)
- [ ] Warns about a potential error (problem)
- [x] Suggests an alternate way of doing something (suggestion)
- [ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about (it will be better if you can provide both good and bad examples):
Are you willing to submit a pull request to implement this rule?