eslint: Indent rule bug in arrays when first value has indent

ESlint config:

"indent": [
            2,
            4
        ],

Current behavior:

Code 1:

var a = [
                'a',
                'b'
        ];

Error: “Expected indentation of 12 space characters but found 16 (indent).”

Code 2:

var a = ['a',
                'b'
        ];

Error: None

Expected behavior: Both options don’t throw any error as for JSHint option "indent": 4 as described on http://eslint.org/docs/rules/indent.html#compatibility

Other ESlint version: 1.6.0

<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: 15 (13 by maintainers)

Most upvoted comments

@sstern6 Thanks for all your efforts. I wont be able to reply for few days as i workin on some critical issue at work. Just wanted to let u know. Posting this message without reading the whole thread. Sorry buddy but I will be back (Thanks for understanding). Again I want to thank u for all ur efforts.

@ilyavolodin @gyandeeps thanks will probably have this up by mid to end of this coming week. Will definitely have questions for you!

Thank you