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.

Wrong output indentation in all messages if one message has a long multiline quote

See original GitHub issue

What version of ESLint are you using?

2.11.1

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

default

Please show your full configuration:

{
  "root": true,

  "extends": [
    "eslint:recommended",
    "airbnb-base"
  ],

  "parserOptions": {
    "ecmaVersion": 7,
    "sourceType": "script"
  },

  "env": {
    "browser": false,
    "es6": true,
    "node": true
  },

  "rules": {
    "arrow-parens": [2, "as-needed"],
    "eqeqeq": 2,
    "key-spacing": [2, { "beforeColon": false, "afterColon": true, "mode": "minimum" }],
    "no-console": 0,
    "no-eq-null": 2,
    "no-extra-parens": [2, "all"],
    "no-multi-spaces": 0,
    "no-unused-vars": 2,
    "no-use-before-define": [2, { "functions": false }],
    "quotes": [2, "single"],
    "spaced-comment": [2, "always", { "exceptions": ["/", "*"] }],
    "strict": [2, "global"],
    "unicode-bom": [2, "always"]
  }
}

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

const http = require('http');

http.request({
  // Param
  // Param
  // Param
}).on('response', response => {
  // Do something with response.
  // Do something with response.
  // Do something with response.
  // Do something with response.
  // Do something with response.
  // Do something with response.
  // Do something with response.
  // Do something with response.
  // Do something with response.
  // Do something with response.
}).on('error', error => {
  // Do something with error.
  // Do something with error.
  // Do something with error.
  // Do something with error.
  // Do something with error.
  // Do something with error.
  // Do something with error.
  // Do something with error.
  // Do something with error.
  // Do something with error.
}).end();

What did you expect to happen?

An output with readable indentation and alignment.

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

1

Compare with the output after the last error fixed:

2

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
ilyavolodincommented, Jun 8, 2016

It looks like a bug that we should fix. However, I don’t think we should fix formatter itself, but instead we should modify newline-per-chained-call to not dump that much information into the error message.

0reactions
mysticateacommented, Jun 9, 2016

Ah OK. Default allows 2 chained and disallows 3rd and later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Poor handling of multi-line string literals using slash continuation
Make a small Python file containing the following: if True: # Pointless if-statement just for indentation here: print("\ \nMESSAGE - printing a ...
Read more >
CMake multiline message with FATAL_ERROR - Stack Overflow
It goes to stderr. Formatted lines will" " be indented an additional 2 spaces beyond what was provided in the output" " string....
Read more >
Here documents, or how to create multi-line strings in Perl
A here-document allows you to create a string that spreads on multiple lines and preserves white spaces and new-lines. If you run the ......
Read more >
[Review] SE-0168: Multi-Line String Literals - Swift Forums
For instance, if one line used a tab and other lines used spaces, Swift would not strip indentation from any of the lines;...
Read more >
YAML Superpowers, part 2: Multiline Strings
When you use single quotes '' , the string won't be escaped. This means that every character will be interpreted verbatim – including...
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