Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
mobile ruleP2stack specificStack: android
androidcomposeconventionmodifier
Put modifier: Modifier first among a composable's parameters
Follow the Compose convention of the optional `modifier: Modifier = Modifier` being the first parameter (after required ones) for consistency and readability.
PR: profico-mining-2026-06Created: Jul 26, 2026
Bad example
Old codekotlin
| 1 | @Composable fun Card(title: String, onClick: () -> Unit, modifier: Modifier = Modifier) |
Explanation (EN)
Objašnjenje (HR)
Good example
New codekotlin
| 1 | @Composable fun Card(modifier: Modifier = Modifier, title: String, onClick: () -> Unit) |
Explanation (EN)
Objašnjenje (HR)