detekt-rules-compose
detekt-rules-compose copied to clipboard
A collection of Detekt rules for Jetpack Compose
``` @Composable fun MyComposable( modifier: Modifier = Modifier, content: LazyListScope.() -> Unit ) = LazyColumn(modifier = modifier, content = content) ``` `ModifierParameterPosition` and `ComposableParametersOrdering` raise an issue. The `content` parameter...
```kotlin @ExperimentalAnimationGraphicsApi @ExperimentalCoilApi @ExperimentalComposeUiApi @Composable fun ProductView( product: Product, modifier: Modifier = Modifier, //unused ) { val ... Card( modifier = Modifier .fillMaxWidth() ```
I think that code like this should be also flagged: ```kotlin @Composable private fun Foo( onSomething: (Int) -> Unit, ) { Button(onClick = { onSomething(5) }) { /*...*/ } }...
Given this code: ```kotlin internal sealed class State { object Loading : State() data class Data(val id: String) : State() } @Composable internal fun MyButton( state: State, onClick: (String) ->...
## Expected Behavior I have a @Composable that receives a modifier, and the first child is ProvideWindowInsets that has no modifier parameter, and I put the received modifier on the...
I get a false positive on this rule when using the following syntax: ```kotlin // Part of theme file @Composable fun AppTheme(content: @Composable () -> Unit) { // Theme setup...
If you specify Modifier.height(Intrinsic.Min) then this rule should not apply, because you allow the views to be drawn out fully and then wrap the content. This is useful when you...
This code reports `ConditionCouldBeLifted` while it shouldn't: technically it's legal to have pager with an "empty" page. ```kotlin HorizontalPager(...) { pageIndex -> val branchEntry = entries.elementAtOrNull(pageIndex) if (branchEntry != null)...
1.3.0 fixed a lot a false positives of `ReusedModifierInstance`. But there is one that it wasn't fixed yet. I created a test case to make it easy to reproduce it:...
I like the idea of `TopLevelComposableFunctions`. The composable function shouldn't be declared inside an `Activity` or anything like that. But some times I have a Module were I want to...