Hello! Quick question regarding formatting in comp...
# getting-started
f
Hello! Quick question regarding formatting in compose and IntelliJ. Is there a plugin/tool that formats the code in the editor (i.e. ⇧+alt+⌘ + L) and a CLI tool to ensure consistency?
c
There is #CKS3XG0LS for both CLI and as a Jetbrains IDE plugin
1
f
Thanks you @Chrimaeon! I just added it to my IDE, and... to add the Compose rules to the IDE seems that I have to download a
.jar
based on this docs I've tried it in two projects and.. Do I have to add that to every project that I open? Also, I'm getting an error in all my composables about the naming having to be all lower case, shouldn't the new rules take care of that or do I need to remove the rule in my .editorconfig? 🤔
c
Do I have to add that to every project that I open?
yes both the plugin and the rules plugin need to be applied to each project individualy - not all projects that use ktlint are compose projects 😉
Also, I’m getting an error in all my composables about the naming having to be all lower case, shouldn’t the new rules take care of that or do I need to remove the rule in my .editorconfig?
you need this in your `.editorconfig`:
Copy code
ktlint_function_naming_ignore_when_annotated_with=Composable
see the Note in https://pinterest.github.io/ktlint/latest/rules/standard/#function-naming
f
That makes sense! Thank you a lot! Appreciate that you took the time to answer my question 😄
👍🏻 1