Skip to content

Commit

Permalink
update doc for typescript useDefineForClassFields compiler flag
Browse files Browse the repository at this point in the history
  • Loading branch information
akphi committed Oct 8, 2020
1 parent 8586096 commit 70c8ebe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/plugin-transform-typescript.md
Expand Up @@ -189,6 +189,8 @@ When enabled, type-only class fields are only removed if they are prefixed with
class A {
declare foo: string; // Removed
bar: string; // Initialized to undefined
prop?: string; // Initialized to undefined
prop1!: string // Initialized to undefined
}
```

Expand Down Expand Up @@ -257,6 +259,8 @@ equivalents in Babel can be enabled by some configuration options or plugins.
- `--target`
Babel doesn't support targeting a specific version of the language, but you can choose which engines you want to target using [`@babel/preset-env`](https://babeljs.io/docs/en/babel-preset-env).
If you prefer, you can enable [individual plugins](https://babeljs.io/docs/en/plugins) for every ECMAScript feature.
- `--useDefineForClassFields`
You can use the `onlyRemoveTypeImports` option to replicate this behavior.
- `--watch`, `-w`
When using `@babel/cli`, you can specify the [`--watch` option](https://babeljs.io/docs/en/babel-cli#compile-files).

Expand Down
2 changes: 2 additions & 0 deletions docs/preset-typescript.md
Expand Up @@ -93,6 +93,8 @@ When enabled, type-only class fields are only removed if they are prefixed with
class A {
declare foo: string; // Removed
bar: string; // Initialized to undefined
prop?: string; // Initialized to undefined
prop1!: string // Initialized to undefined
}
```

Expand Down

0 comments on commit 70c8ebe

Please sign in to comment.