eslint: Indent rule doesn’t validate multiline expressions

The following example has no error:

if (true) {
    a = (
1 +
2);
}

I would expect the following errors:

3:0  error  Expected indentation of 8 characters  indent
4:0  error  Expected indentation of 8 characters  indent

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I’m working on something to hopefully address part of this issue, specifically enforcing indentation of multi-line chained properties. So the end user will be able to choose this style:

foo()
.bar
.baz();

Or this style instead:

foo()
  .bar
  .baz();

And so on…

Any indication as to when we can expect the fix associated with this will be available?

@5minpause The work I did was merged in 95ea25a45ee4ae327f2e306272d39384e5d4602f. I imagine it will be in the version of ESLint that comes out in a few days.

@kentor No, but that issue is also known and will hopefully be fixed relatively soon.

edit: Actually, I guess it falls under this issue as well, so that case will probably be fixed once this issue is fixed. Also see https://github.com/eslint/eslint/issues/6007 and https://github.com/eslint/eslint/issues/7274.