dart-code-metrics icon indicating copy to clipboard operation
dart-code-metrics copied to clipboard

[Rule change] Add const keyword to "prefer-correct-edge-insets-constructor" rule

Open orevial opened this issue 2 years ago • 0 comments

So the EdgeInset rule is great and it even has an autofix, I would just suggest that we add the "const" keyword when applying the auto-fix as it is a recommended good practice : https://dart-lang.github.io/linter/lints/prefer_const_constructors.html.

Currently we have to do two steps to reach a "valid" code when basic lint rules are applied :

  1. Apply EdgeInset auto-fix
  2. Apply Flutter lints const constructor auto-fix

From what I see in the code it seems pretty easy to add this in the rule's validator file and I could propose the associated PR but I just don't want to miss something here.

orevial avatar Aug 05 '22 10:08 orevial

@orevial hi, yeah, that would be a great improvement! If you want to contribute, we'd really appreciate that

incendial avatar Aug 11 '22 07:08 incendial

Available in 4.18.0 🚀

incendial avatar Sep 12 '22 15:09 incendial