Hi, is there a rule to enforce vertical alignment ...
# ktlint
b
Hi, is there a rule to enforce vertical alignment in chains? E.g. force this
Copy code
listOf(1, 2, 3, 4).filter { it > 3 }
    .map { it * it }
into this
Copy code
listOf(1, 2, 3, 4)
    .filter { it > 3 }
    .map { it * it }
Thanks
And then you'd need to set
ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than
to 2
b
When 1st line of chain does not exceed max line length it remains unchanged. So no vertical alignment in that case.
p
Did you enable the experimental ruleset or this specific rule,?
b
Above sample is with a list but my actual case is with
Either
: I want
.map{}
and
.mapLeft{}
to be vertically aligned.
@Paul Dingemans had only enabled that specific rule. It does work as excpted with experimental rules enabled. Thanks
👍 1