Another iteration on the TS plugin readme (#7469)
This commit is contained in:
parent
fdfbd9a6f7
commit
53208d6998
@ -6,15 +6,10 @@ Does not type-check its input. For that, you will need to install and set up Typ
|
||||
|
||||
## Caveats
|
||||
|
||||
* Does not support [`namespace`][namespace]s.
|
||||
* Does not support [`const enum`][const_enum]s because those require type information to transpile.
|
||||
* Does not support [`export =`][exin] and [`import =`][exin], because those cannot be transpiled to ES.next.
|
||||
|
||||
## Workarounds
|
||||
|
||||
* `namespace`: Migrate to using the `module { }` syntax instead.
|
||||
* `const enum`: Remove the `const`, which makes it available at runtime.
|
||||
* `export =` \ `import =`: Convert to using `export default` and `export const`.
|
||||
* Does not support [`namespace`][namespace]s. **Workaround**: Move to using [file exports][fm], or migrate to using the `module { }` syntax instead.
|
||||
* Does not support [`const enum`][const_enum]s because those require type information to compile.
|
||||
**Workaround**: Remove the `const`, which makes it available at runtime.
|
||||
* Does not support [`export =`][exin] and [`import =`][exin], because those cannot be compile to ES.next. **Workaround**: Convert to using `export default` and `export const`, and `import x, {y} from "z"`.
|
||||
|
||||
## Example
|
||||
|
||||
@ -65,3 +60,4 @@ require("@babel/core").transform("code", {
|
||||
[const_enum]: https://www.typescriptlang.org/docs/handbook/enums.html#const-enums
|
||||
[namespace]: https://www.typescriptlang.org/docs/handbook/namespaces.html
|
||||
[exin]: https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require
|
||||
[fm]: https://github.com/Microsoft/dtslint/blob/master/docs/no-single-declare-module.md
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user