@@ -1373,6 +1373,36 @@ When using the Azure Cosmos DB extension for VS Code, you can create .mongo file
13731373db.users.find({ someField: { $exists: true } });
13741374` ` `
13751375
1376+ #### JavaScript : Better formatting for inline ` await ` expression nested in calls ([#6856 ] by [@thorn0 ])
1377+
1378+ <!-- prettier -ignore -->
1379+ ` ` ` js
1380+ // Input
1381+ async function f() {
1382+ const admins = (await(db.select('*').from('admins').leftJoin('bla').where('id', 'in', [1,2,3,4]))).map(({id, name})=>({id, name}))
1383+ }
1384+
1385+ // Output (Prettier stable)
1386+ async function f() {
1387+ const admins = (await db
1388+ .select("*")
1389+ .from("admins")
1390+ .leftJoin("bla")
1391+ .where("id", "in", [1, 2, 3, 4])).map(({ id, name }) => ({ id, name }));
1392+ }
1393+
1394+ // Output (Prettier master)
1395+ async function f() {
1396+ const admins = (
1397+ await db
1398+ .select("*")
1399+ .from("admins")
1400+ .leftJoin("bla")
1401+ .where("id", "in", [1, 2, 3, 4])
1402+ ).map(({ id, name }) => ({ id, name }));
1403+ }
1404+ ` ` `
1405+
13761406[#5682 ]: https : // github.com/prettier/prettier/pull/5682
13771407[#6657 ]: https : // github.com/prettier/prettier/pull/6657
13781408[#5910 ]: https : // github.com/prettier/prettier/pull/5910
@@ -1422,6 +1452,7 @@ db.users.find({ someField: { $exists: true } });
14221452[#6687 ]: https : // github.com/prettier/prettier/pull/6687
14231453[#6796 ]: https : // github.com/prettier/prettier/pull/6796
14241454[#6848 ]: https : // github.com/prettier/prettier/pull/6848
1455+ [#6856 ]: https : // github.com/prettier/prettier/pull/6856
14251456[@brainkim ]: https : // github.com/brainkim
14261457[@duailibe ]: https : // github.com/duailibe
14271458[@gavinjoyce ]: https : // github.com/gavinjoyce
0 commit comments