Skip to content

[4.0.0] indent + multiline expression not working as expected #8721

@Trott

Description

@Trott

Tell us about your environment

  • ESLint Version: 4.0.0
  • Node Version: 8.1.0
  • npm Version: 5.0.3

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration:

rules:
  indent: [2, 2, {ArrayExpression: first,
                  CallExpression: {arguments: first},
                  FunctionDeclaration: {parameters: first},
                  FunctionExpression: {parameters: first},
                  MemberExpression: off,
                  ObjectExpression: first,
                  SwitchCase: 1}]

What did you do? Please include the actual source code causing the issue.

var foo = bar(function() {
  doSomething();
}).baz(function() {
  doSomethingElse();
});

What did you expect to happen? No errors.

What actually happened? Please include the actual, raw output from ESLint.

$ eslint foo.js

/Users/trott/test/foo.js
  4:1  error  Expected indentation of 4 spaces but found 2  indent
  5:1  error  Expected indentation of 2 spaces but found 0  indent

✖ 2 problems (2 errors, 0 warnings)
  2 errors, 0 warnings potentially fixable with the `--fix` option.

$

I'm not sure if this has the same root cause as #8717 or if it is distinct...

Metadata

Metadata

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyindentRelates to the `indent` ruleruleRelates to ESLint's core rules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions