Module

Whine.Core.CommaFirstRecords

Package
purescript-whine-core
Repository
collegevine/purescript-whine

Checks that array literals are written comma-first style, with elements aligned vertically, one space to the right of the commas.

Single-line arrays are ok.

Several elements on the same line are ok, as long as the first one of them is aligned correctly.

-- Good:
{ x: 'foo'
, y: 42
, z: true
}

-- Good:
{ x: 'foo', y: 42, z: true }

-- Good:
{ x: 'foo', y: 42
, z: true
, w: false
, v: 0, u: 1
}

-- Bad:
{ x: 'foo'
 , y: 42
, z: true
}

-- Bad:
{
  x: 'foo',
  y: 42,
  z: true
}

-- Bad:
{ x: 'foo', y: 42,
  z: true }

#rule Source

rule :: JSON -> Rule