1.5.0
- Behavior change: The stability checks (
ComposeUnstableReceiver,ComposeMutableParameters,ComposeUnstableCollections) are now disabled by default as they are significantly less important in the era of Compose strong skipping. Re-enable them via the newstability-checksoption inlint.xml. See https://slackhq.github.io/compose-lints/rules/#stability. - New: Add
ComposeItemKeyHashCodeto flaghashCode()used inLazy*/Pageritem keys. Item keys must be unique, but hashCodes are not. See https://slackhq.github.io/compose-lints/rules/#dont-use-hashcode-as-a-key. - New: Add
ComposeRedundantComposableto flag functions/properties annotated@Composablethat don't use the composition (no@Composablecalls or property reads), so the annotation can be removed. See https://slackhq.github.io/compose-lints/rules/#remove-unnecessary-composable-annotations. - Enhancement: Improve
ModifierReuseddata flow analysis. This addresses several past issues with modifier parameter use in composables. - Enhancement:
ComposeViewModelForwardingis now smarter: it detectsViewModels forwarded inside nested blocks (e.g.Row { Composable(viewModel) }), follows reassignments (e.g.val vm = viewModel; Other(vm)) via data-flow analysis instead of name matching, and no longer flags capitalized non-composable calls (such as event handlers) that happen to take aViewModel. - Fix: Fix
ComposeUnstableReceiverfalse positives on Kotlinvalue classreceivers and on composable members ofvalue classtypes. Value classes are now treated as stable when their underlying property type is stable, including for compiled cross-module classes (via a metadata-aware evaluator). - Fix: Fix the
stability-checksoption being intermittently ignored: each stability check now registers its own option instance, since a single instance shared across issues had its (lint-internal) issue back-reference overwritten depending on class-load order, causing the configured value to resolve against the wrong issue. - Removed: Remove the
ComposeRememberMissingrule in favor of Compose's ownUnrememberedMutableStatelint, which ships with the Compose runtime, is enabled by default, and covers more state builders without the false positives our rule had. See #490. - Build against lint
32.2.1. - Target Kotlin 2.2 (matches lint 32.*).
Special thanks to @aasitnikov for contributing to this release!
What's Changed
- Update dependency pymdown-extensions to v10.21.3 by @slack-oss-bot in #533
- Update plugin ksp to v2.3.8 by @slack-oss-bot in #534
- Update plugin spotless to v8.5.1 by @slack-oss-bot in #535
- Update dependency click to v8.4.1 by @slack-oss-bot in #536
- Update lint.latest to v32.2.1 by @slack-oss-bot in #528
- Update plugin lint to v9.2.1 by @slack-oss-bot in #529
- Update Gradle to v9.5.1 by @slack-oss-bot in #532
- Update dependency com.android.tools.lint:lint-api to v32.2.1 by @slack-oss-bot in #527
- Modifier reused - use code flow analysis by @aasitnikov in #454
- Update renovatebot/github-action action to v46 by @slack-oss-bot in #538
- Update dependency com.facebook:ktfmt to v0.62 by @slack-oss-bot in #500
- Fix value class stability detection + disable stability detection by default by @ZacSweers in #541
- Add more modifier tests by @ZacSweers in #540
- Add detector for using hashCode() in keys by @ZacSweers in #542
- Remove RememberMissingDetector by @ZacSweers in #539
- Fix nested viewmodel call forwarding by @ZacSweers in #544
- Add redundant composable detection by @ZacSweers in #543
New Contributors
- @aasitnikov made their first contribution in #454
Full Changelog: 1.4.3...1.5.0