Files
test-repo/changelog_unreleased/javascript/13340.md
T

17 lines
466 B
Markdown

#### Fix cursor positioning for files containing emoji (#13340 by @fisker)
```console
$ 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: [] }
```