Skip to content

Latest commit

 

History

History
executable file
·
85 lines (69 loc) · 1.16 KB

no-object-property-split.md

File metadata and controls

executable file
·
85 lines (69 loc) · 1.16 KB

Disallow object property values from appearing on a different line from their key (no-object-property-split)

When declaring an object property, the value of a property should appear on the same line as the key to avoid confusion.

Rule Details

The following patterns are considered warnings:

var a = {b:
1};

var a = {
    b:
    12,
    c: 13, d: 14,
    e:
15
};

var a = {
    b:
    [
        {c: 100},
        {d: 101}
    ]
};

var a = {
    b:
    {
        c: 100,
        d: 101
    }
};

var a = {
    b: {
        c:
        100,
        d: 101
    }
};

The following patterns are not considered warnings:

var a =
    {
        b: 12
    };

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

var a = {b: 1};

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

var a = {
    b: [
        {c: 100},
        {d: 101}
    ]
};

var a = {
    b: {
        c: 100,
        d: 101
    }
};

Related Rules

Resources