A babel plugin that beautifies JavaScript
npm i --save-dev babel-plugin-transform-beautifier
Then add the plugin to your babel config:
// babel.config.js
module.exports = {
plugins: [
'babel-plugin-transform-beautifier'
]
}
The following code:
testA ? consequent() : testB && alternate()
Will be transformed to:
if (testA) {
consequent()
} else if (testB) {
alternate()
}