Indent: Issue with a wrong indented start statement
See original GitHub issueEslint version: master Parser: default
Code:
/* eslint indent: [2, 2] */
if (true){
for (;;){ // <-\n
b(); // <-\n
}
}
Current output:
3:5 - Expected indentation of 2 space characters but found 4.
5:3 - Expected indentation of 4 space characters but found 2.
Expected output:
3:5 - Expected indentation of 2 space characters but found 4.
4:7 - Expected indentation of 4 space characters but found 6.
Note: This also trips the fix
for such code.
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
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 >How to fix indentation Error in Python - Numpy Ninja
The indentation error can occur when the spaces or tabs are not placed properly. There will not be an issue if the interpreter...
Read more >expected an indented block” Error in Your Python Code
The “IndentationError: expected an indented block” error is something you're likely to see when you first start using Python, especially if you' ...
Read more >How does Indentation Error Work in Python? - eduCBA
Python is a procedural language. The indentation error can occur when the spaces or tabs are not placed properly. There will not be...
Read more >What should I do with "Unexpected indent" in Python?
"How do I rectify the error ..."? By identifying where it occurred and fixing the cause of the error. In this case, by...
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 Free
Top 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
I’m not sure if it’s the same thing, but I found this issue with
--fix
:Input:
Output
Expected output
I can confirm with @bfred-it that attempt to convert indent from spaces to tabs mess up all of the files.