nbadal / ktlint-intellij-plugin

Ktlint plugin for IntelliJ IDEA + Android Studio
MIT License
151 stars 23 forks source link

Miss matching Function name with @Composable Annotation #495

Closed ashrafatef843 closed 3 months ago

ashrafatef843 commented 3 months ago

Compose rules doesn't work inside the plugin.

Compose rule version jar: v0.3.13 Android studio version: Android Studio Hedgehog | 2023.1.1 Ktlint plugin version: 0.21.0

@Composable
fun TestCompose() {
}

Error: Function name should start with a lowercase letter (except factory methods) and use camel case (standard:function-naming)

.editorconfig:

root = true

[*]
insert_final_newline = false
max_line_length = 100

[{*.kt,*.kts}]
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_continuation_indent_size = 4
paul-dingemans commented 3 months ago

Did you configure this correctly in your .editorconfig? See https://pinterest.github.io/ktlint/latest/rules/standard/#function-naming

ashrafatef843 commented 3 months ago

@paul-dingemans No I just downloaded the jar file of ktlint and added it to the plugin inside the field of Ruleset Jars.

image

paul-dingemans commented 3 months ago

That is not enough. You need to configure to avoid conflict with ktlint rules. See ktlint documentation link above.