indent rule: Invalid indentation for array in sequencing function calls
See original GitHub issueWhat 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:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👍 Thanks for checking this out. I’m having the same issue.
@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