How can I configure eslint to enforce Haskell/Elm record style for objects in Javascript?

Viewed 156

I'm finally working on a Javascript project in which I can dictate the coding style, and I would like to use Haskell/Elm records style for objects, that is:

const imAnObject =
    { key1: "Value"
    , key2: 1337
    , obj:
      { hi: "I'm an object!"
      }
    , arr:
      [ "This
      , "is an"
      , "array"
      ]
    }

I've managed to configure the space after comma, and commas on start of new line, but I want to configure also [{ to start on new line (preferably only on long lines) and space after them, and the whole aligning thing. Any ideas on how to achieve that? Eslint has a lot of options and they are not as searchable as I would have wished for.

0 Answers
Related