I would like to keep a if function in one line without using ternary if but prettier format breaks it, I didn't find a option for that in prettier documentation
tag script inside .vue file
WANTED OUTPUT
<script>
export default {
methods: {
changeSlide(slideIndex) {
if (slideIndex >= this.slides.length) { slideIndex = 0 }
}
},
}
</script>
prettier format
<script>
export default {
methods: {
changeSlide(slideIndex) {
if (slideIndex >= this.slides.length) {
slideIndex = 0
}
}
},
}
</script>
I'm working with Nuxt(VueJS)
my prettier config:
{
"semi": false,
"singleQuote": true,
"tabWidth": 4,
"useTabs": true,
"printWidth": 120
}