Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
466 B
466 B
Fix cursor positioning for files containing emoji (#13340 by @fisker)
$ cat test.js
const { formatWithCursor } = await import("prettier");
const code = "'😀😀😀😀'";
await formatWithCursor(code, {parser: "babel", cursorOffset: 9})
# Prettier stable
$ node test.js
{ formatted: '"😀😀😀😀";\n', cursorOffset: 5, comments: [] }
# Prettier main
$ node test.js
{ formatted: '"😀😀😀😀";\n', cursorOffset: 9, comments: [] }