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.

Indention failures after operator linebreaks

See original GitHub issue

My environment:

  • ESLint Version:
  • Node Version: 10.15.3
  • npm Version: 6.9.0

Parser version: default

Configuration
{
  "env": {
    "es6": true,
    "mocha": true,
    "mongo": true,
    "node": true
  },
  "globals": {},
  "rules": {
    "indent": [
      2,
      4,
      {
        "SwitchCase": 1,
        "CallExpression": {
          "arguments": 1
        }
      }
    ],
    "operator-linebreak": [
      2,
      "after",
      {
        "overrides":
        {
          "?": "before",
          ":": "before"
        }
      }
    ]
  }
}
test('Error occurs only when use new line after operator. ' +
    'Here is new line.',
    log);
eslint /path/to/test.js

I expect eslint check will succeed. Actually it fails with error:

/path/to/test.js
  3:1  error  Expected indentation of 0 spaces but found 4  indent

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
sempashacommented, May 28, 2019
0reactions
eslint-deprecated[bot]commented, Jun 29, 2019

Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If you break long code lines, how do you indent the stuff on the ...
Operators at the end of each line instead of the beginning of subsequent lines, to very clearly indicate visually that the line is...
Read more >
Newline after logical operators chooses a bad line break
Steps to reproduce: Write the following code: df <- data.frame(col1 = 1:10) df[ col1 < 5 & ] Put the typing focus where...
Read more >
How to avoid automatic indents after \input caused by a ...
The linebreak \\ after "Second (long) paragraph." causes an automatic indent in the subsequent line "Third (long) paragraph." as one can see in ......
Read more >
Best practice for avoiding line break bugs in long expressions
Your editor should indent correctly, and that can serve as a warning. That said, the best practice is to avoid expressions spanning multiple ......
Read more >
3 Presentation Markup
MathML conveys this meaning by using the &ApplyFunction; operator after the " f " ... elements control linebreaking and indentation of the following...
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