- Notifications
You must be signed in to change notification settings - Fork471
Open
Description
Comparing ReScript's behavior to Prettier's, Prettier is consistent for types and values, but ReScript is not.
My proposal is tostandardize on Prettier's behavior, also because it seems to follow user intention better. If the user put the first record field on a separate line, we may assume that they intend to keep the formatting multiline and/or add more fields later.
Prettier
Types
typeX={a:number};typeY={a:number};typeZ={a:number};
reformats to
typeX={a:number};typeY={a:number};typeZ={a:number;};
Values
letx={a:2};letx={a:2,};letx={a:2,};
reformats to
letx={a:2};letx={a:2};letx={a:2,};
ReScript
Types
typex= {a:int}typey= {a:int}typez= {a:int,}
reformats to
type x = {a: int}type y = {a: int}type z = {a: int}Values
letx= {a:2}letx= {a:2}letx= {a:2}
reformats to
let x = {a: 2}let x = { a: 2,}let x = { a: 2,}