Skip to content

Releases: slackhq/compose-lints

1.4.2

22 Oct 17:11
Compare
Choose a tag to compare
  • Enhancement: Better handle name shadowing in SlotReused lint and reduce false positives.
  • Test against lint 31.8.0-alpha07.
  • Various doc fixes.
  • Build against lint 31.7.1.
  • Build against Kotlin 2.0.21. Still targeting Kotlin 1.9 language version (lint 31.7.x's language version).

Special thanks to @SimonMarquis and @alexvanyo for contributing to this release!

What's Changed

New Contributors

Full Changelog: 1.4.1...1.4.2

1.4.1

02 Oct 20:25
Compare
Choose a tag to compare
  • Fix: Fix false positives reported by ComposeContentEmitterReturningValues.
  • Fix: Fix content-emitters configuration in docs.
  • Fix: Fix link to multipreview annotations in docs.

Special thanks to @erikghonyan for contributing to this release!

What's Changed

  • Fix link to multipreview annotations in docs by @erikghonyan in #418
  • Fix false positives for ComposeContentEmitterReturningValues by @ZacSweers in #420

New Contributors

Full Changelog: 1.4.0...1.4.1

1.4.0

02 Oct 04:46
Compare
Choose a tag to compare
  • New: Implement SlotReused lint. See https://slackhq.github.io/compose-lints/rules/#do-not-invoke-slots-in-more-than-once-place for more information.
  • Enhancement: Report the function name for readability in ComposeContentEmitterReturningValues.
  • Enhancement: Check for inherited @Preview annotations up to four levels.
  • Enhancement: Allow @VisibleForTesting/@TestOnly-annotated preview composables to be public.
  • Fix: Don't report duplicate errors about multiple content emitters.
  • Fix: Normalize lint option loading to match with individual issues.
  • Fix: Use name of parameter if text is not available.
  • Removed: Delete obsolete ComposeComposableModifier lint check.
  • Various docs fixes.
  • Build against Lint 8.7.0.
  • Update api and minApi to 16 (i.e. lint 8.7.0+). It's possible this may work with API 15 but we have not tested it.
  • Test against Lint 8.8.0-alpha04.
  • Test against K2 UAST.
  • Build against Kotlin 2.0.20.

Special thanks to @alexvanyo, @seve-andre, @svenjacobs, @ychescale9, @shahzadansari, @kozaxinan, for contributing to this release!

What's Changed

Read more

1.3.1

25 Jan 23:24
Compare
Choose a tag to compare
  • Lower the lint API back to 14, not 15.

Full Changelog: 1.3.0...1.3.1

1.3.0

25 Jan 19:34
Compare
Choose a tag to compare
  • New: Implement ModifierComposed check to lint against use of Modifier.composed, which is no longer recommended in favor of the new Modifier.Node API.
  • New: Implement ComposeUnstableReceiver check to warn when composable extension functions or composables instance functions have unstable receivers/containing classes.
  • New: Check for property accessors with composition locals.
  • Enhancement: The ComposeComposableModifier message now recommends the new Modifier.Node API.
  • Enhancement: Make lints significantly more robust to edge cases like typealiases, import aliases, parentheses, fully-qualified references, and whitespace. Our tests now cover all these cases.
  • Enhancement: Update @Preview detection to also detect Compose Desktop's own @Preview annotation.
  • Enhancement: Improve the ComposeParameterOrder check to only lint the parameter list and add a quickfix.
  • Enhancement: Add support for checking for loops in multiple content emitters.
  • Fix: Fix allowed names config for Unit-returning functions.
  • Fix: Ignore context receivers in multiple content emissions lint.
  • Fix: Allow nullable types for trailing lambdas in ComposeParameterOrder.
  • Fix: Best-effort work around name mangling when comparing name in M2ApiDetector's allow list.
  • Fix: Fix ComposePreviewPublic to always just require private, remove preview parameter configuration.
  • Docs: Improve docs for ComposeContentEmitterReturningValues
  • Build against lint-api 31.2.2.
  • Test against lint-api 31.4.0-alpha06.
  • Raise Kotlin apiVersion/languageVersion to 1.9.0.

Special thanks to @jzbrooks, @joeMalebe, and @dellisd for contributing to this release!

What's Changed

Read more

1.2.0

19 Apr 14:28
Compare
Choose a tag to compare
  • Fix: Only run ComposeM2Api checks on Kotlin files.
  • Update lint current and min API to 14, aka AGP 8.0.0+.

What's Changed

Full Changelog: 1.1.1...1.2.0

1.1.1

08 Mar 18:08
Compare
Choose a tag to compare
  • Fix: Use setEnabledByDefault(false) instead of IGNORE in ComposeM2Api. This is what we intended before, too, but didn't realize there was a dedicated API for it. Note that this changes configuration slightly as you must now explicitly enable the rule too and not just the severity. See the docs: https://slackhq.github.io/compose-lints/rules/#use-material-3.

What's Changed

Full Changelog: 1.1.0...1.1.1

1.1.0

07 Mar 19:09
Compare
Choose a tag to compare
  • New: Add ComposeM2Api rule. This rule can be used to lint against using "Material 2" (androidx.compose.material) APIs in codebases that have migrated to Material 3 (M3). This rule is disabled by default, see the docs for more information: https://slackhq.github.io/compose-lints/rules/#use-material-3.
  • Enhancement: Add viewmodel-factories lint option to ComposeViewModelInjection. This allows you to define your own known ViewModel factories. Thanks to @WhosNickDoglio for contributing this!
  • Build against lint-api to 30.4.2.
  • Test against lint 31.1.0-alpha08.

What's Changed

New Contributors

Full Changelog: 1.0.1...1.1.0

1.0.1

15 Feb 16:12
Compare
Choose a tag to compare

Changes

New Contributors

Full Changelog: 1.0.0...1.0.1

1.0.0

09 Feb 21:33
Compare
Choose a tag to compare

Initial release!

This is a near-full port of the original rule set to lint. It should be mostly at parity with the original rules as well.

The lints target lint-api 30.4.0/lint API 13 and target Java 11.

See the docs for full usage and information: https://slackhq.github.io/compose-lints.

Notes

  • ComposeViewModelInjection does not offer a quickfix yet. PRs welcome!
  • ComposeUnstableCollections is a warning by default rather than an error.
  • CompositionLocalNaming is not ported because this is offered in compose's bundled lint rules now.