Skip to content

Commit

Permalink
docs(@babel/parser): Document allowUndeclaredExports option.
Browse files Browse the repository at this point in the history
Documents the changes from babel/babel#9864
implemented by @nicolo-ribaudo.
  • Loading branch information
benjamn committed Jun 18, 2019
1 parent bf903de commit e3b2617
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/parser.md
Expand Up @@ -46,6 +46,12 @@ mind. When in doubt, use `.parse()`.
outside of class and object methods. Set this to `true` to accept such
code.

- **allowUndeclaredExports**: By default, exporting an identifier that was
not declared in the current module scope will raise an error. Set this
option to `true` to prevent the parser from complaining about undeclared
exports, if you are sure the appropriate declarations will be added by
transforms later in the plugin pipeline.

- **sourceType**: Indicate the mode the code should be parsed in. Can be
one of `"script"`, `"module"`, or `"unambiguous"`. Defaults to `"script"`. `"unambiguous"` will make @babel/parser attempt to _guess_, based on the presence of ES6 `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`.

Expand Down

0 comments on commit e3b2617

Please sign in to comment.