Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure multiline chains of calls are correctly indented #930

Merged
merged 1 commit into from Feb 18, 2017

Conversation

astorije
Copy link
Member

@astorije astorije commented Feb 18, 2017

See http://eslint.org/docs/rules/indent#memberexpression for more info.

Without this option, the following examples are passing ESLint:

foo()
.bar(); // 0 tabs

foo()
		.bar() // 2 tabs
	.baz(); // 1 tab

foo()
  .bar() // 2 spaces
	.baz(); // 1 tab

I noticed this issue while reviewing #929, which passed CI with:

program
	.option("    --private", "mode")
  .parse(process.argv)
	.description("Start the server")

Without this rule, the following examples are passing ESLint:

```js
foo()
.bar(); // 0 tabs

foo()
		.bar() // 2 tabs
	.baz(); // 1 tab

foo()
  .bar() // 2 spaces
	.baz(); // 1 tab
```
@astorije astorije added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label Feb 18, 2017
@astorije astorije added this to the 2.2.2 milestone Feb 18, 2017
@astorije astorije requested a review from xPaw February 18, 2017 07:01
@xPaw xPaw merged commit 213a4b0 into master Feb 18, 2017
@xPaw xPaw deleted the astorije/indent-multiline-chain branch February 18, 2017 08:41
@astorije astorije added Type: Feature Tickets that describe a desired feature or PRs that add them to the project. and removed Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. labels Mar 6, 2017
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
…line-chain

Make sure multiline chains of calls are correctly indented
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Tickets that describe a desired feature or PRs that add them to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants