So, I was wondering if it is possible to stop prettier from adding an extra tab for .then() {}
statements after Promise.try
or just simple return PromiseFn() .then(() => {})..
Usually, I write promise chains, that look something like this:
import Promise from "Bluebird"
Promise.try() {
// code..
})
.then(() => {
// more core
})
.then(() => {
// more code
})
How prettier makes it look like:
Promise.try() {
// code..
})
.then(() => {
// more core
})
.then(() => {
// more code
})
So I was wondering, if it is possible to stop prettier from adding the extra, non-needed tab before all the .then()
statements?
It seems Prettier is a very opinionated formatter...
But you may be able to flag to Prettier to ignore the next node
// prettier-ignore
Promise.try() {
// code..
})
.then(() => {
// more core
})
.then(() => {
// more code
})
We dropped using Prettier in our project for this reason, it didn't allow for formatting how we wanted to. And TBH I'm not even sure the above will still work for what you want, but it seems the best option to try.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With