question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Indent rule bug in arrays when first value has indent

See original GitHub issue

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>

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
gyandeepscommented, Sep 17, 2016

@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.

1reaction
sstern6commented, Sep 10, 2016

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

Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

PhpStorm array indentation 8 spaces in stead of 4
The problem still persists though, in some files arrays just indent with 8 spaces. If I then reformat the code, it returns to...
Read more >
indent - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
enforce consistent indentation (indent-legacy) - ESLint
This rule enforces a consistent indentation style. The default style is 4 spaces . Options. This rule has a mixed option: For example,...
Read more >
Indentation Error in Python | How to Solve it - Edureka
This article will provide you with a detailed understanding of Indentation error in Python and the solutions to avoid the same.
Read more >
Indent the first line of a paragraph - Microsoft Support
When you press Enter to start the next paragraph, its first line will be indented. Tip: If you want to change indentation for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found