I just wanted to note that since the cursorOffset option (introduced in #1637) works by tracking the cursor position relative to an AST node (rather than a CST token), it can produce incorrect results. For example:
$ echo "return 15" | prettier --cursor-offset 15 # the cursor is positioned immediately before `15`
return 15;
15
(related to prettier/prettier-vscode#12 (comment))
I just wanted to note that since the
cursorOffsetoption (introduced in #1637) works by tracking the cursor position relative to an AST node (rather than a CST token), it can produce incorrect results. For example:(related to prettier/prettier-vscode#12 (comment))