fixes [skip ci]
This commit is contained in:
parent
daf0ca8680
commit
51eef099b3
@ -226,7 +226,7 @@ If the test requires a minimum Node version, you can add `minNodeVersion` (must
|
||||
}
|
||||
```
|
||||
|
||||
#### `@babel/parser`
|
||||
#### `@babel/parser` (babylon)
|
||||
|
||||
Writing tests for the babel parser is very
|
||||
similar to the other packages.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# @babel/generator
|
||||
|
||||
> Turns a [The Babel Parser AST](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md) into code.
|
||||
> Turns the [babel AST](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md) into code.
|
||||
|
||||
## Install
|
||||
|
||||
@ -11,7 +11,7 @@ npm install --save-dev @babel/generator
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import {parse} from 'babylon';
|
||||
import {parse} from '@babel/parser';
|
||||
import generate from '@babel/generator';
|
||||
|
||||
const code = 'class Example {}';
|
||||
@ -57,7 +57,7 @@ should be the source filenames, and values should be the source content.
|
||||
Here's an example of what that might look like:
|
||||
|
||||
```js
|
||||
import {parse} from 'babylon';
|
||||
import {parse} from '@babel/parser';
|
||||
import generate from '@babel/generator';
|
||||
|
||||
const a = 'var a = 1;';
|
||||
|
||||
@ -148,13 +148,13 @@ require("@babel/parser").parse("code", {
|
||||
|
||||
### FAQ
|
||||
|
||||
#### Will the babel parser support a plugin system?
|
||||
#### Will the Babel parser support a plugin system?
|
||||
|
||||
Previous issues: [#1351](https://github.com/babel/babel/issues/1351), [#6694](https://github.com/babel/babel/issues/6694).
|
||||
|
||||
We currently aren't willing to commit to supporting the API for plugins or the resulting ecosystem (there is already enough work maintaining Babel's own plugin system). It's not clear how to make that API effective, and it would limit our ability to refactor and optimize the codebase.
|
||||
|
||||
Our current recommendation for those that want to create their own custom syntax is for users to fork babel parser.
|
||||
Our current recommendation for those that want to create their own custom syntax is for users to fork the parser.
|
||||
|
||||
To consume your custom parser, you can add to your `.babelrc` via its npm package name or require it if using JavaScript,
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
These are the core Babylon AST node types.
|
||||
These are the core @babel/parser (babylon) AST node types.
|
||||
|
||||
- [Node objects](#node-objects)
|
||||
- [Changes](#changes)
|
||||
@ -144,7 +144,7 @@ interface Position {
|
||||
|
||||
# Changes
|
||||
|
||||
### Babylon 7
|
||||
### @babel/parser (Babylon) v7
|
||||
|
||||
Flow: Node renamed from `ExistentialTypeParam` to `ExistsTypeAnnotation` [#322](https://github.com/babel/babylon/pull/322)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user