Refactor move docs (#8108)

* feat: [skip] generate readme script

* docs: [skip ci] update READMEs

* docs: [skip ci] fix code block type

* chore: [skip ci] move generator script
This commit is contained in:
Sven SAULEAU
2018-06-04 16:32:39 +02:00
committed by Henry Zhu
parent b6eaaa2496
commit b445b79734
143 changed files with 1286 additions and 11238 deletions

View File

@@ -1,60 +1,19 @@
# @babel/plugin-syntax-decorators
> Allow parsing of decorators.
> Allow parsing of decorators
## Installation
See our website [@babel/plugin-syntax-decorators](https://new.babeljs.io/docs/en/next/babel-plugin-syntax-decorators.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-syntax-decorators
npm install --save @babel/plugin-syntax-decorators
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["@babel/plugin-syntax-decorators"]
}
```
### Via CLI
or using yarn:
```sh
babel --plugins @babel/plugin-syntax-decorators script.js
yarn add --save @babel/plugin-syntax-decorators
```
### Via Node API
```javascript
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-syntax-decorators"]
});
```
## Options
### `legacy`
`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)