Rename "babylon" with "babel" (#5647)

This commit is contained in:
Wei-Wei Wu authored and Ika committed 2018-12-27 21:05:19 +08:00
1 parent a18d80253a
commit 91c20f7fbe
271 files changed
+792 -772

No files matched your search

+4 -4
View File
@@ -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, parser: "babylon" });
prettier.format("foo ( );", { semi: false, parser: "babel" });
// -> "foo()"
```
@@ -27,7 +27,7 @@ prettier.format("foo ( );", { semi: false, parser: "babylon" });
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, parser: "babylon" });
prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babel" });
// -> { formatted: '1;\n', cursorOffset: 1 }
```
@@ -130,8 +130,8 @@ Prettier's built-in parsers are exposed as properties on the `parsers` argument.
```js
prettier.format("lodash ( )", {
parser(text, { babylon }) {
const ast = babylon(text);
parser(text, { babel }) {
const ast = babel(text);
ast.program.body[0].expression.callee.name = "_";
return ast;
}