compose-lints
compose-lints copied to clipboard
Lint checks to aid with a healthy adoption of Compose
When creating a custom composable `Modifier`, the rule [ComposeComposableModifier](https://slackhq.github.io/compose-lints/rules/#avoid-modifier-extension-factory-functions) is applied. However this is now [officially permitted by Google](https://developer.android.com/develop/ui/compose/custom-modifiers#create_a_custom_modifier_using_a_composable_modifier_factory) since `composed {}` is no longer recommended.
 ```kotlin // 👇 false negative @Composable private fun TestWithIf() { if (someCondition()) { Text("1") Text("2") } else { Text("2") Text("3") } } // 👇...
Add a rule for something along the lines of: "Don't call `Locale.getDefault()` in a `@Composable` context, use `LocalConfiguration.current.locales` instead." Calling `Locale.getDefault()` won't recompose if the locale changes (Configuration change), Also,...
Proposed rule: don't use hashCode in the item key for Lazy* Composables [Item key should be unique](https://developer.android.com/develop/ui/compose/lists#item-keys). `.hashCode()` is not unique. e.g. these all have [the same hash code](https://www.andreinc.net/2022/09/01/patological-input-for-the-java-hash-tables), even...
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [livereload](https://togithub.com/lepture/python-livereload) | minor | `==2.6.3` -> `==2.7.0` | --- ### Release Notes lepture/python-livereload ### [`v2.7.0`](https://togithub.com/lepture/python-livereload/blob/HEAD/CHANGES.rst#Version-270)...
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [com.facebook:ktfmt](https://togithub.com/facebook/ktfmt) | dependencies | minor | `0.50` -> `0.51` | --- ### Release...
Update `rules.md` to change the related rule name to be the issue id `ComposeUnstableReceiver` instead of `UnstableReceiverDetector`.
I have something like this in use: ```kotlin private class ButtonParameter : PreviewParameterProvider { override val values: Sequence get() = sequenceOf( listOf("Very, very long button text that takes two lines",...
`SlotReusedDetector` currently won't detect problematic code that looks like the following: ```kotlin @Composable fun Something( flag: Boolean, modifier: Modifier = Modifier, slot: @Composable () -> Unit, ) { Box(modifier) {...
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [gradle](https://gradle.org) ([source](https://redirect.github.com/gradle/gradle)) | minor | `8.10.2` -> `8.14` | --- ### Release Notes gradle/gradle (gradle)...