Create a custom modifier using a composable modifier factory is now recommended, however it is still failing "Avoid Modifier extension factory functions"
Describe the bug
https://twitter.github.io/compose-rules/rules/#avoid-modifier-extension-factory-functions is no longer true now. Refer to the official documentation:
Note: In previous versions of Compose, we recommended against this approach and suggested using composed {} instead via a lint rule. Now that composed {} is not recommended, the lint rule has been removed.
To Reproduce Steps to reproduce the behavior: Adding a new Composable:
@Composable
private fun Modifier.modify(viewModel: xxViewModel) = this then Modifier.viewable(onView = viewModel.onView)
.margin(margin = viewModel.margin)
Expected behavior It should not be flagged as a violation.
Screenshots
Environment com.twitter.compose.rules.detekt of 0.0.26
These have migrated to: https://github.com/mrmans0n/compose-rules https://slackhq.github.io/compose-lints/
@kenyee Thank you for getting back so quickly and informing about the migration! 👍 Assuming https://github.com/twitter/compose-rules is now deprecated. Would you suggest choosing between https://github.com/mrmans0n/compose-rules(ktlint and detekt) and https://slackhq.github.io/compose-lints/(lint) for use? Do their rules overlap to some extent?
use the one that fits your usage best. Slack's is done using Android lint. The original was ktlint+detekt.