Skip to content

1.5.0

Choose a tag to compare

@ZacSweers ZacSweers released this 25 May 23:22
· 89 commits to main since this release
  • 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 new stability-checks option in lint.xml. See https://slackhq.github.io/compose-lints/rules/#stability.
  • New: Add ComposeItemKeyHashCode to flag hashCode() used in Lazy*/Pager item 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 ComposeRedundantComposable to flag functions/properties annotated @Composable that don't use the composition (no @Composable calls or property reads), so the annotation can be removed. See https://slackhq.github.io/compose-lints/rules/#remove-unnecessary-composable-annotations.
  • Enhancement: Improve ModifierReused data flow analysis. This addresses several past issues with modifier parameter use in composables.
  • Enhancement: ComposeViewModelForwarding is now smarter: it detects ViewModels 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 a ViewModel.
  • Fix: Fix ComposeUnstableReceiver false positives on Kotlin value class receivers and on composable members of value class types. 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-checks option 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 ComposeRememberMissing rule in favor of Compose's own UnrememberedMutableState lint, 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

New Contributors

Full Changelog: 1.4.3...1.5.0