MCPcopy Index your code
hub / github.com/prettier/prettier / format

Function format

src/standalone.js:24–30  ·  view source on GitHub ↗
(text, options)

Source from the content-addressed store, hash-verified

22const formatWithCursor = withPlugins(core.formatWithCursor);
23
24async function format(text, options) {
25 const { formatted } = await formatWithCursor(text, {
26 ...options,
27 cursorOffset: -1,
28 });
29 return formatted;
30}
31
32async function check(text, options) {
33 return (await format(text, options)) === text;

Callers 1

checkFunction · 0.70

Calls 1

formatWithCursorFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…