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: Invalid indentation for array in sequencing function calls

See original GitHub issue

What version of ESLint are you using?

2.13.1

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

default

Please show your full configuration:

  • Operation system Linux arch 4.5.4-1-ARCH #1 SMP PREEMPT Wed May 11 22:21:28 CEST 2016 x86_64 GNU/Linux
  • Node.js version v4.4.3

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

Source code:

function f() {    
    return asyncCall()    
        .then(    
            'some string',    
            [                                                                                       
                1,    
                2,    
                3    
            ]    
        );    
}  

Run:

$  ./node_modules/.bin/eslint --env es6  --no-eslintrc --rule 'indent: [2, 4]' test.js 

/home/kostya/test.js
  5:13  error  Expected indentation of 8 space characters but found 12   indent
  6:17  error  Expected indentation of 12 space characters but found 16  indent
  7:17  error  Expected indentation of 12 space characters but found 16  indent
  8:17  error  Expected indentation of 12 space characters but found 16  indent
  9:13  error  Expected indentation of 8 space characters but found 12   indent

✖ 5 problems (5 errors, 0 warnings)

What did you expect to happen?

No errors.

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

See above.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
oatkillercommented, Sep 20, 2016

👍 Thanks for checking this out. I’m having the same issue.

1reaction
sstern6commented, Sep 22, 2016

@platinumazure working on something i believe is related, https://github.com/eslint/eslint/issues/4161#issuecomment-247742813.

Digging into indent.js looks like eslint is having issues indenting with arrays on multiple lines. I have found a few viable ways to approach this but there are a few issues open related to this I am not sure how deep to go, and depending on the approach starts breaking multiple existing tests and each case is different. Looks like theres issues with ArrayExpressions indenting with, nested arrays, objects, and string literals from what I can see.

A few seemingly related issues:

https://github.com/eslint/eslint/issues/4161 https://github.com/eslint/eslint/issues/6007 https://github.com/eslint/eslint/issues/3737

Read more comments on GitHub >

github_iconTop Results From Across the Web

Array does not have indent or space in PyYAML - Stack Overflow
PyYAML's dump() doesn't have the fine control to have a different indent for the mappings (2 positions) and sequences (4 positions), ...
Read more >
Incorrect indentation in array arguments · Issue #2631 - GitHub
PHPCS wants you to include an array indent sniff instead, so that the rules are very clear to it. There is an included...
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 >
YAML Ain't Markup Language (YAML™) revision 1.2.2
YAML's block collections use indentation for scope and begin each entry on its own line. Block sequences indicate each entry with a dash...
Read more >
Source code should be indented consistently
This rule raises an issue when indentation does not match the configured value. Only the first line of a badly indented section is...
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