-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentslang:javascriptIssues affecting JSIssues affecting JS
Description
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-quoteInput:
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
}Metadata
Metadata
Assignees
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentslang:javascriptIssues affecting JSIssues affecting JS