Is there any way to prevent line break?
Prettier 2.2.1
Playground link
--html-whitespace-sensitivity ignore
--parser babel
--prose-wrap always
--quote-props preserve
--no-semi
--single-quote
Input:
const taskA = () => {}
const taskB = () => {}
const taskC = () => {}
/**
* @param {boolean} is - test param
*/
function test(is) {
if(is) taskA() // is === True => TaskA
else if(!is) taskB() // is === False => TaskB
else taskC() // is === undefined => TaskC
}
Output:
const taskA = () => {}
const taskB = () => {}
const taskC = () => {}
/**
* @param {boolean} is - test param
*/
function test(is) {
if (is) taskA()
// is === True => TaskA
else if (!is) taskB()
// is === False => TaskB
else taskC() // is === undefined => TaskC
}
Expected behavior:
const taskA = () => {}
const taskB = () => {}
const taskC = () => {}
/**
* @param {boolean} is - test param
*/
function test(is) {
if (is) taskA() // is === True => TaskA
else if (!is) taskB() // is === False => TaskB
else taskC() // is === undefined => TaskC
}
Is there any way to prevent line break?
Prettier 2.2.1
Playground link
Input:
Output:
Expected behavior: