From bfa191f07c73d44b391f3d43805e67c3fcfee1c9 Mon Sep 17 00:00:00 2001 From: Berton Zhu Date: Mon, 28 May 2018 18:12:22 +0800 Subject: [PATCH] Update example code in Doc to v1.13 (#4578) --- docs/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index 082237b06..0b8419c51 100644 --- a/docs/api.md +++ b/docs/api.md @@ -12,7 +12,7 @@ const prettier = require("prettier"); `format` is used to format text using Prettier. [Options](options.md) may be provided to override the defaults. ```js -prettier.format("foo ( );", { semi: false }); +prettier.format("foo ( );", { semi: false, parser: 'babylon' }); // -> "foo()" ``` @@ -27,7 +27,7 @@ prettier.format("foo ( );", { semi: false }); The `cursorOffset` option should be provided, to specify where the cursor is. This option cannot be used with `rangeStart` and `rangeEnd`. ```js -prettier.formatWithCursor(" 1", { cursorOffset: 2 }); +prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: 'babylon' }); // -> { formatted: '1;\n', cursorOffset: 1 } ```