Several options are ignored / broken
See original GitHub issueAfter 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:
- Created 6 years ago
- Reactions:1
- Comments:17 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes I think we’re good ! Closing this thanks @langdonx @rhengles
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?