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.

Can you explain why is this happening?

See original GitHub issue

Prettier Version: 1.6.1 / master

Code

Instead of this:

assert.equal(this.$().text().trim(), true);

in VSCode I have this on prettify (LAlt + LShift + F):

assert.equal(
  this.$()
    .text()
    .trim(),
  true
);

Why?

I think single line is better no?

I have all default. Latest versione (stable) of VScode and latest version of Prettier plugin for VScode.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
vjeuxcommented, Sep 5, 2017

Unfortunately, making a pretty printer that works perfectly in 100% of the cases is not possible in practice, so we have to make tradeoffs. We tried --really hard-- to make it work with line width but issues kept coming in with code that was very hard to understand because of it.

In case of those pieces of code that are very hard to print in a good way, we opted to err on the side of minimizing cases where the output looks terrible and makes the code harder to understand even though there are legit cases (like yours) where the code is going to look not optimal, but isn’t the end of the world.

I’m closing it so quickly because it’s not a new issue that hasn’t had much thoughts put in. I probably spent a month full time trying to make chained method calls work great. We’re unlikely going to be able to solve your use case, I’m afraid.

0reactions
ghostcommented, Sep 5, 2017

I think you shouldn’t close the issue anyway. Maybe someone have a clue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can you explain why this happens? - Quora
Our brain, with experience,l earns that things in shadows are brighter than they actually look.
Read more >
Can you explain what is happening when I feel physical ...
Sometimes during prayer or a priestly blessing, I can feel a physical sensation, such as a power field “hitting me”, even pushing me ......
Read more >
Could you explain what is happening in this code? [duplicate]
Method to check whether the given year is leap year or not is. If the year is evenly divisible by 4, go to...
Read more >
10 ways to explain things more effectively 1. Keep in mind ...
An example of an open-ended question would be “Can you show me how you do XYZ or “Help me to understand what happens...
Read more >
explain how such a thing could <have happened><happen>
Hello to all, Thanks for reading my post. Context: Something bad happened. Two people are talking. One person is asking the other how...
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