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 expects wrong indentation for logical/arithmetic expressions

See original GitHub issue

What version of ESLint are you using?

3.1.1

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

default

Please show your full configuration:

indent: [
    'error',
    4,
    {
        SwitchCase: 1
    }
]

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

(function() {
    var x = 0 ||
        {
            a: 1,
            b: 2
        };

    var y = x ||
        true;
})();

What did you expect to happen?

I expected it not to have an error about the indentation on lines 3-6

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

/home/user/test.js
  3:13  error  Expected indentation of 4 space characters but found 8   indent
  4:17  error  Expected indentation of 8 space characters but found 12  indent
  5:17  error  Expected indentation of 8 space characters but found 12  indent
  6:13  error  Expected indentation of 4 space characters but found 8   indent
  8:9   error  'y' is defined but never used                            no-unused-vars

✖ 5 problems (5 errors, 0 warnings)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ilyavolodincommented, Jul 24, 2016

@alecharmon We would definitely appreciate a pull request for this issue. However, keep in mind, this is most likely part of the multiline issue with indent rule, which is much larger. You can search open issues for other reports related to multiline indentation problems.

0reactions
alecharmoncommented, Sep 7, 2016

code is ready for a pr, will work on getting that up tomorrow

Read more comments on GitHub >

github_iconTop 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 does Indentation Error Work in Python? - eduCBA
This will help you in understanding which line contains the error or does not have the expected whitespaces. Python arranges all lines of...
Read more >
Indentation in Python - GeeksforGeeks
To indicate a block of code in Python, you must indent each line of the block by the same whitespace. The two lines...
Read more >
Optional Braces - Scala 3 - EPFL
Optional Braces · First, some badly indented programs are flagged with warnings. · Second, some occurrences of braces {...} are made optional. Generally,...
Read more >
I'm getting an IndentationError. How do I fix it? - Stack Overflow
However, if you are sure the line does need to be indented, the indentation needs to match that of a former statement in...
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