Files
openide/libraries/detekt-compose-rules/README.md
Sebastiano Poggi 3c1387b581 [JEWEL-920] Add Detekt Compose rules to the project
We now apply additional Compose rules to our Detekt checks. The rules
are documented at https://mrmans0n.github.io/compose-rules/rules/

A couple of rules have been disabled as they do not apply to Jewel as
a library. The rules JAR was added to the repository so that it can
also be used by the IntelliJ Detekt plugin, and show issues in the IJ
editor.

This applies trivial fixes from the rules, leaving difficult ones for
a later time (suppressed and filed tech debt issues to fix them).

Notable changes from applying the rules:
 * Fixed a bug in `BasicLazyTree` where a derived state was not
   remembered.
 * Fixed a bug in `ButtonImpl` where the `onStateChange`, accessed in
   a `LaunchedEffect`, was not used as a key to the effect. We have
   recently fixed a similar bug in JEWEL-868.
 * Fixed the same kind of bug in `ListComboBox`.
 * Fixed the same kind of bug in `CircularProgressIndicator`.
 * Fixed several missing remember keys in `PopupMenu`'s `MenuContent`.
 * Fixed a bug in `ContextMenu` where the focus manager and input mode
   manager were not remembered.
 * Deprecated several mistakenly public APIs in Menu.kt, and made them
   to delegate to a now-private implementation, so the public one can
   be safely removed in the future.
 * Made sure there is no indication set by default, instead of the
   stock one provided by Compose.
 * Adjusted the signature of many internal composables.
 * Improved the SLC and tree samples in the showcase.
 * Added a simpler variant to Modifier.outline().

This also adds an artifact so that we get a JAR for our own Detekt
rules plugin when the IDE is built from JPS.

closes https://github.com/JetBrains/intellij-community/pull/3161

GitOrigin-RevId: c8bb6f5c91fe96e7fce075d1d45dd6605019409b
2025-08-12 08:50:54 +00:00

357 B

Detekt Compose Rules

This module defines custom Detekt rules for Jetpack Compose used in the Jewel codebase.

Usage:

  • This module exists only to produce a JAR file used to provide rules to a Detekt plugin.
  • Do not add it as a runtime or compile dependency of other modules.
  • Consume the resulting JAR via Detekt IDEA plugin.