Skip to content

Latest commit

 

History

History
executable file
·
43 lines (31 loc) · 853 Bytes

no-object-properties-one-line.md

File metadata and controls

executable file
·
43 lines (31 loc) · 853 Bytes

Disallow multiple object properties to be declared on one line (no-object-properties-one-line)

When declaring an object with multiple properties it is desirable to declare each property of the object on a separate line.

Rule Details

The following patterns are considered warnings:

var a = {b: 1, c: 2};

var a = {
    b: 1, c: 2,
    d: 3
};

The following patterns are not considered warnings:

var a = {};

var a = {b: 1};

var a = {b: 1,
         c: 2};

var a = {
    b: 1,
    c: 2};

var a = {
    b: 1,
    c: 2
};

Related Rules

Resources