Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 988 Bytes

no-object-properties-last-line.md

File metadata and controls

46 lines (33 loc) · 988 Bytes

Disallow last property of a multiple property object to be declared on last line (no-object-properties-last-line)

When declaring an object with multiple properties it is desirable to declare each property of the object on a separate line with the last line containing only the closing brace and the last property name/value on the preceding line.

Rule Details

The following patterns are considered warnings:

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

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

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

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
};

Related Rules

Resources