New rule: object-property-newline #524

Closed
feross opened this Issue May 17, 2016 · 4 comments

Projects

None yet

2 participants

@feross
Owner
feross commented May 17, 2016

Enforce placing object properties on separate lines.

eslint rule: https://github.com/eslint/eslint/blob/master/docs/rules/object-property-newline.md

    "object-property-newline": [2, { "allowMultiplePropertiesPerLine": true }]

OK:

var obj = { foo: 'foo', bar: 'bar', baz: 'baz' }

var obj2 = {
    foo: 'foo', bar: 'bar', baz: 'baz'
}

Not OK:

var obj = { foo: 'foo',
  bar: 'bar', baz: 'baz'
}

var obj = {
  foo: 'foo', bar: 'bar',
  baz: 'baz'
}

Ecosystem breakage:

# tests 427
# pass  419
# fail  8
@feross feross referenced this issue Jul 13, 2016
Closed

Release proposal: standard v8 #564

16 of 16 tasks complete
@feross feross added a commit to feross/eslint-config-standard that closed this issue Jul 13, 2016
@feross Enforce placing object properties on separate lines (object-property-…
…newline)

Fixes feross/standard#524
ebe08d0
@feross
Owner
feross commented Jul 13, 2016

This rule will be included in standard v8

@saadq saadq referenced this issue in nodejs/nodejs.org Aug 25, 2016
Merged

Update dependencies #873

@KidkArolis

Hm, this means I can no longer use a "dsl" like this :(

module.exports = [
  { name: 'application', path: '/', component: Application, abstract: true, children: [
    { name: 'home', path: '', component: Home },
    { name: 'messages', async: Messages },
    { name: 'status', path: ':user/status/:id' },
    { name: 'profile', path: ':user', component: Profile, abstract: true, children: [
      { name: 'profile.index', path: '', component: ProfileIndex },
      { name: 'profile.lists' },
      { name: 'profile.edit' }
    ]}
  ]}
]
@feross
Owner
feross commented Sep 10, 2016

@KidkArolis Sorry this makes life a bit more difficult for you. You can selectively disable this rule in files where you're defining DSLs by adding a comment to the top of the file:

/* eslint-disable object-property-newline */
@KidkArolis

Yeah, no worries, <3 standard, found a couple workarounds.
On Sat, 10 Sep 2016 at 20:44, Feross Aboukhadijeh notifications@github.com
wrote:

@KidkArolis https://github.com/KidkArolis Sorry this makes life a bit
more difficult for you. You can selectively disable this rule in files
where you're defining DSLs by adding a comment to the top of the file:

/* eslint-disable object-property-newline */


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#524 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AATzWG5AAh_zSqv7hbvhjpa008wT0utEks5qowiYgaJpZM4If1Y0
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment