Update syntax-decorators options (#7938)

* Add decoratorsBeforeExport to the syntax plugin
* Require legacy: true, like in the transform plugin
This commit is contained in:
Nicolò Ribaudo
2018-05-30 22:00:18 +02:00
committed by GitHub
parent 21b9b2e42d
commit cb17f07ac9
7 changed files with 135 additions and 5 deletions

View File

@@ -41,3 +41,20 @@ require("@babel/core").transform("code", {
`boolean`, defaults to `false`.
Use the legacy (stage 1) decorators syntax.
### `decoratorsBeforeExport`
`boolean`, defaults to `true`.
```js
// decoratorsBeforeExport: true
@decorator
export class Foo {}
// decoratorsBeforeExport: false
export @decorator class Bar {}
```
This option was added to help tc39 collect feedback from the community by allowing experimentation with both possible syntaxes.
For more information, check out: [tc39/proposal-decorators#69](https://github.com/tc39/proposal-decorators/issues/69)