avoid_classes_with_only_static_members
with static final members
#59895
Labels
analyzer-linter
Issues with the analyzer's support for the linter package
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
linter-false-positive
P2
A bug or feature request we're likely to work on
According to "Effective Dart: Design", it is encouraged to avoid defining a class that contains only static members, but this isn't a hard rule. For example, with constants and enum-like types, it may be natural to group them in a class.
I have an issue with
static final
members. I believe they should be considered as constants and it should be allowed to group static constant and final members in classes.There are some types that don't have a constant constructor, so the only way to create constant values of such types is by using
final
keyword.But the analyzer complains about such classes as they have a static final member.
The text was updated successfully, but these errors were encountered: