reason icon indicating copy to clipboard operation
reason copied to clipboard

refmt makes record fields with `bs` annotations harder to read

Open mlms13 opened this issue 7 years ago • 0 comments

This is purely subjective, so feel free to close if you disagree, but it bothered me enough that I thought I'd mention it. :smile: The following code:

[@bs.deriving abstract]
type t = {
  [@bs.optional] filename: string,
  [@bs.optional] onWarning: Js.Exn.t => unit,
  [@bs.optional] schema: schema,
  [@bs.optional] json: bool,
};

gets turned into:

[@bs.deriving abstract]
type t = {
  [@bs.optional]
  filename: string,
  [@bs.optional]
  onWarning: Js.Exn.t => unit,
  [@bs.optional]
  schema,
  [@bs.optional]
  json: bool,
};

after refmt works its magic. The refmt'd version is inconsistent with the formatting used in the bucklescript object docs, and in my opinion it's substantially harder to make sense of.

mlms13 avatar Oct 18 '18 05:10 mlms13