-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 1.18.2
Playground link
--parser babelInput:
async function HelloWorld({greeting = "hello", greeted = '"World"', silent = false, onMouseOver,}) {
const admins = (await(db.select('*').from('admins').leftJoin('bla').where('id', 'in', [1,2,3,4]))).map(({id, name})=>({id, name}))
}Output:
async function HelloWorld({
greeting = "hello",
greeted = '"World"',
silent = false,
onMouseOver
}) {
const admins = (await db
.select("*")
.from("admins")
.leftJoin("bla")
.where("id", "in", [1, 2, 3, 4])).map(({ id, name }) => ({ id, name }));
}Expected behavior:
As you can see the map method is on the same line at the end, and it looks weird.
I think that this looks much better:
async function HelloWorld() {
const admins = (await db
.select("*")
.from("admins")
.leftJoin("bla")
.where("id", "in", [1, 2, 3, 4])
)
.map(({ id, name }) => ({ id, name }));
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.