appKODE / detekt-rules-compose

A collection of Detekt rules for Jetpack Compose
MIT License
136 stars 8 forks source link

Update ModifierParameterPosition to skip non-optional parameters #1

Closed dimsuz closed 2 years ago

dimsuz commented 2 years ago

Currently the ModifierParameterPosition rule requires modifier to be placed as a first parameter, but Compose actually has a convention for it to be first optional parameter:

Adam Powell wrote

The official convention is that the modifier param is the first optional parameter in the list. The idea is that you never have to type modifier = in the parameter list, it can always be specified positionally if the only other parameters you're using are required