Workiva / workiva_analysis_options

Workiva's shared Dart static analysis options
Other
3 stars 1 forks source link

[lint] avoid_setters_without_getters #34

Open evanweible-wf opened 4 years ago

evanweible-wf commented 4 years ago

http://dart-lang.github.io/linter/lints/avoid_setters_without_getters.html

dustyholmes-wf commented 2 years ago

I have found that this lint collides pretty heavily with avoid_positional_boolean_parameters.

We see this collision frequently in API objects. Consumers of a module can set a state, but have little to no reason to read that state.

void setFeatureEnabled(bool isEnabled) {...}

The following satisfies both lints, but feels bad to pretty much everyone.

void setFeatureEnabled({required bool isEnabled}){...}

My personal preference would be for avoid_positional_boolean_parameters instead.