import { formatWithCursor } from "https://deno.land/x/deno@v0.22.0/std/prettier/vendor/standalone.d.ts";
formatWithCursor both formats the code, and translates a cursor position from unformatted code to formatted code. This is useful for editor integrations, to prevent the cursor from moving when code is formatted
The cursorOffset option should be provided, to specify where the cursor is. This option cannot be used with rangeStart and rangeEnd.
prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babel" });
-> { formatted: '1;\n', cursorOffset: 1 }
Parameters
options: CursorOptions