You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose that the documentation for all linter rule "Usage" sections is misleading, because the rule is not activated without the boolean value following the key entry.
For example, here is the "Usage" section at the bottom of the avoid_classes_with_only_static_members rule:
To enable the avoid_classes_with_only_static_members rule, add avoid_classes_with_only_static_members under linter > rules in your [analysis_options.yaml](https://dart.dev/tools/analysis) file:
linter:
rules:
- avoid_classes_with_only_static_members
The problem is that without explicitly adding true to the end of the key, i.e. avoid_classes_with_only_static_members: true, the rule is not activated. Put another way, it is reasonable to assume that merely listing the value in the analysis_options.yaml file would be sufficient to activate it (as I mistakenly presumed).
Expected fix
I propose merely adding true to the end of every listed key_value. This would also imply that false is equally viable. Note that I would be happy to perform this rote task, presuming this change is deemed worthwhile.
Additional context
No response
I would like to fix this problem.
I will try and fix this problem on dart.dev.
The text was updated successfully, but these errors were encountered:
This syntax no longer appears to work correctly, as it doesn't trigger lint errors for package imports. Updating the rule syntax to:
linter:
rules:
- prefer_relative_imports: true
seems to resolve the issue. I think that earlier versions of the analyzer may have implicitly interpreted the first format correctly. However, it seems that newer versions of the Dart analyzer now require the boolean attribute to be explicit.
Page URL
https://dart.dev/tools/linter-rules/avoid_classes_with_only_static_members.html
Page source
https://github.com/dart-lang/site-www/tree/main/src/content/tools/linter-rules/individual-rules.md
Describe the problem
I propose that the documentation for all linter rule "Usage" sections is misleading, because the rule is not activated without the boolean value following the key entry.
For example, here is the "Usage" section at the bottom of the
avoid_classes_with_only_static_members
rule:The problem is that without explicitly adding true to the end of the key, i.e.
avoid_classes_with_only_static_members: true
, the rule is not activated. Put another way, it is reasonable to assume that merely listing the value in the analysis_options.yaml file would be sufficient to activate it (as I mistakenly presumed).Expected fix
I propose merely adding
true
to the end of every listed key_value. This would also imply thatfalse
is equally viable. Note that I would be happy to perform this rote task, presuming this change is deemed worthwhile.Additional context
No response
I would like to fix this problem.
The text was updated successfully, but these errors were encountered: