Closed MaryaBelanger closed 1 month ago
Visit the preview URL for this PR (updated for commit 921ddae156e2a052a705499c941c1fbb3eead35f):
Hmm I think this a bit different, the lint is about calling an already existing
const
constructor. While the Effective Dart rule is about making the constructor declarationconst
.
I agree.
Perhaps https://dart.dev/tools/linter-rules/prefer_const_constructors_in_immutables would be more related?
Sort of, but it's specific to classes marked with the @immutable
annotation, so not really. We don't have a lint that matches this guideline.
We don't, in general, have lints for the CONSIDER
guidelines because there tend to be too many false positives to make having a lint add any value to the user.
I see now that it's not an exact match. Thank you both for explaining! I'll close this
Links the Effect Dart entry "CONSIDER making your constructor const if the class supports it" to the
prefer_const_constructors
lint.Section staged here: https://dart-dev--pr5862-const-lint-aiwlnawg.web.app/effective-dart/design#consider-making-your-constructor-const-if-the-class-supports-it