I found the formatter gets rid of tagged template literals when they are followed by an arrow expression. It does not happen if the tagged literal is the last expression in the chain.
Happens with 11.1.4 and 12.0.0-rc.3 at least.
Original
sql
->SQL.query`INSERT INTO my_table (a, b, c) VALUES ${a}, ${b}, ${c}`
->Promise.thenResolve(Console.log)
Expected
No change
Actual
sql
->(
SQL.query(
[`INSERT INTO my_table (a, b, c) VALUES `, `, `, `, `, ``],
[a, b, c],
)
)
->Promise.thenResolve(Console.log)
Playground
https://rescript-lang.org/try?version=v12.0.0-rc.3&module=esmodule&code=M4RwNgUAtAfAygRQDIDoQFcCmAnAngAwEkA5OAUQCUAVAAhKoHkaBbXAfQBcBDAIzExoAKLgBoaPMQGMAlDQBqAQSQBVMnBoASAN5cAvmO099mrZN35oMAArYA9swCWwTCg4ALTADsKmYLbAAbpiCAMK2nn78KGC2AObSQA