:wave: Hey folks Did anyone manage to setup any ...
# multiplatform
p
👋 Hey folks Did anyone manage to setup any compose linters on the common main?
f
you can use the ktlint ide plugin, with some extra rules
p
Thanks @François 🙏
z
For rules I highly recommend https://github.com/mrmans0n/compose-rules
f
You can also use the detekt IDE plugin
gratitude thank you 1
Copy code
compose rule for detekt :

naming:
  FunctionNaming:
    functionPattern: '[a-zA-Z][a-zA-Z0-9]*'
    ignoreAnnotated: ['Composable']
  TopLevelPropertyNaming:
    constantPattern: '[A-Z][A-Za-z0-9]*'

complexity:
  LongParameterList:
    functionThreshold: 42
    ignoreDefaultParameters: true
  TooManyFunctions:
    ignoreAnnotatedFunctions: [ 'Preview' ]

style:
  MagicNumber:
    ignorePropertyDeclaration: true
    ignoreCompanionObjectPropertyDeclaration: true
  UnusedPrivateMember:
    ignoreAnnotated: ['Preview']
p
Yeah @zt Plan is same. 😅 i recently happened to integrate slack’s compose lints in android project as those are on top of Android Lint I was trying to see where the one that’s forked from twitter rules will fit in. For CMP, this is the best