https://kotlinlang.org logo
#ktlint
Title
# ktlint
x

xenomachina

12/13/2023, 8:53 PM
Sometimes I have a
mapOf
...
Copy code
val myMap =
    mapOf(
        "foo" to computeFoo(),
        "bar" to computeBar(),
        "baz" to computeBaz(),
    )
...and I'd like to add comments to it explaining what groups of mapping are for:
Copy code
val myMap =
    mapOf(
        // a comment about "foo"
        "foo" to computeFoo(),

        // a comment about "bar" and "baz"
        "bar" to computeBar(),
        "baz" to computeBaz(),
    )
However, ktlint complains:
Unexpected blank line(s) in value argument list
I tried disabling this with `.editorconfig`:
Copy code
ktlint_no-blank-line-in-list = disabled
but that doesn't seem to work. ktlint still complains about the blank lines. How can I get it to ignore them?
2 Views