syntax
syntax copied to clipboard
Formatter: multiline -> expressions and indentation inside records
Code currently formats like this:
type t = {x: int}
let f = x => {
{
x: x
->Belt.Option.map(succ)
->Belt.Option.map(succ)
->Belt.Option.map(succ)
->Belt.Option.getExn,
}
}
The lines beginning with -> are aligned with the record field name, which looks confusing IMO.
Would it be better to format it like this?
type t = {x: int}
let f = x => {
{
x:
x
->Belt.Option.map(succ)
->Belt.Option.map(succ)
->Belt.Option.map(succ)
->Belt.Option.getExn,
}
}
The -> lines are more indented which seems clearer to me.