prettier-miscellaneous: Several options are ignored / broken
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;
}
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 17 (3 by maintainers)
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?
@langdonx
Thank you, will do it as soon as I can.