Skip to content

Commit

Permalink
Update README for Babel TypeScript Plugin (babel#7443)
Browse files Browse the repository at this point in the history
  • Loading branch information
orta authored and existentialism committed Mar 1, 2018
1 parent 007f8d1 commit fdfbd9a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/babel-plugin-transform-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
Does not type-check its input. For that, you will need to install and set up TypeScript.

Does not support `namespace`s or `const enum`s because those require type information to transpile.
Also does not support `export =` and `import =`, because those cannot be transpiled to ES.next.
## 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`.

## Example

Expand Down Expand Up @@ -52,3 +61,7 @@ require("@babel/core").transform("code", {
plugins: ["@babel/plugin-transform-typescript"]
});
```

[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

0 comments on commit fdfbd9a

Please sign in to comment.