Update syntax-decorators options (#7938)
* Add decoratorsBeforeExport to the syntax plugin * Require legacy: true, like in the transform plugin
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user