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.

Several options are ignored / broken

See original GitHub issue

After doing some tests it seems at least 2 options are ignored an 1 broken on current binary:

  • bracesSpacing (at least from 1.2.2)
  • breakBeforeElse (at least from 1.2.2)
  • flattenTernaries (at least from 1.3.1)

Here’s my test file

class Bambi {
   toto() {
       let tata = true;

       if (tata) { return true; } else { return false; }

       let franckie = `jackie ${tata} ${tata}`;

       return new Promise(resolve => {
           resolve(true);
       });
   }
}

Then running prettier --write --break-before-else --bracket-spacing test1.js

Output:

class Bambi {
   toto() {
       let tata = true;

       if (tata) { 
           return true; 
       } else { 
           return false; 
       }

       let franckie = `jackie ${tata} ${tata}`;

       return new Promise(resolve => {
           resolve(true);
       });
   }
}

The output is the same without these flags.

flattenTernaries after breaking the ternary will continuously add a linebreak when running several times.

toto() {
    let toto = true;
    return toto ? toto : false;
}

Output after 3 times:

toto() {
    let toto = true;
    return;


        toto ? toto : 
        false;
}

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
remimarsalcommented, Jun 9, 2017

Yes I think we’re good ! Closing this thanks @langdonx @rhengles

1reaction
langdonxcommented, Jun 8, 2017

I made separate issues for the the 2 known (code-related) bugs that came out of here.

Aside from those 2 and the npm issue, I think that everything we discussed here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

warning: ignoring broken ref refs/remotes/origin/HEAD
I encountered this recently when someone on my team deleted our old development branch from the remote. I ran this command to check...
Read more >
Answered: Explain the Poem by: Bienvenido Lumbera | bartleby
We who serve and are ignored,. Broken into pieces to be of use. Our heads nod, our arms lift,. Our feet are quick,...
Read more >
tell yum to ignore a single dependency - Server Fault
Generally yum doesn't have options to ignore a single package from the dependencies. Option --skip-broken ignores all unresolved dependences.
Read more >
CHEW ON THIS: DON'T IGNORE BROKEN JAW
The doctor I went to told me I had a broken jaw and that there were several options to treat this, including wiring...
Read more >
Deployment policies and settings - AWS Elastic Beanstalk
AWS Elastic Beanstalk provides several options for how deployments are ... Ignore health check – Prevents a deployment from rolling back when a...
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