Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upChained calls with object argument indentation #257
Comments
albertorestifo
changed the title
Chained calls object indentation
Chained calls with object argument indentation
Sep 13, 2015
This comment has been minimized.
This comment has been minimized.
|
Forgot one, that's what I've been using since the update // 4
const options = { foo: true, bar: false }
promiseFooBar(options)
.then(fooBar => console.log(fooBar))
.catch(err => console.log(err)) |
This comment has been minimized.
This comment has been minimized.
|
they all lgtm except: promiseFooBar({
foo: true,
bar: false })
.then(fooBar => console.log(fooBar))
.catch(err => console.log(err)) |
This comment has been minimized.
This comment has been minimized.
pbrinkmeier
commented
Sep 14, 2015
|
What about that (is more semantic IMO): promiseFooBar({
foo: true,
bar: false
})
.then(fooBar => console.log(fooBar))
.catch(err => console.log(err)) |
This comment has been minimized.
This comment has been minimized.
|
@reg4in It makes it harder to detect a chained call when looking at a lot of code. But yeah, it also satisfies the Standard rules, so it's a valid option |
This comment has been minimized.
This comment has been minimized.
pbrinkmeier
commented
Sep 14, 2015
|
@albertorestifo I personally don't think so but I won't force anyone to use it |
dcousens
added
the
need more info
label
Sep 14, 2015
This comment has been minimized.
This comment has been minimized.
Which versions specifically? |
This comment has been minimized.
This comment has been minimized.
emgeee
commented
Sep 15, 2015
|
I did some digging into this and it looks to have cropped up starting in v5.0.0 when the There looks to be an open issue for eslint here: eslint/eslint#3614 that discusses adding more customization around indentation and chaining. |
This comment has been minimized.
This comment has been minimized.
|
@emgeee |
This comment has been minimized.
This comment has been minimized.
|
Yeah, unfortunately eslint reimplemented the There's nothing we can do about it. |
albertorestifo commentedSep 13, 2015
Before the latest Standard update I could do this:
Now the new indentation rules forces me to do either of the following:
I was very happy using the first example, now not allowed. I understand and respect that the Standard rules are not up to discussion, so I just want to ask:
What way should I indent them?