Skip to content

Commit a9b6b2b

Browse files
committed
Docs for Babel transpiler feature
1 parent b43b667 commit a9b6b2b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/faq.md

+16
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ If it conforms the latest TypeScript services API then yes! Just set the path to
1414

1515
However, please note that the [version](https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#version) in `tsconfig.json` does not indicate the compiler atom is using. That's strictly an aide-mémoire - it's to remind you which version of the TypeScript this project is intended to work with.
1616

17+
## Can I use an alternate transpiler?
18+
Atom-typescript supports using Babel as an alternate ES5 transpiler in coordination with the TypeScript language service. This may be useful if TypeScript does not yet support transpiling a certain feature correctly (for example [scope per for loop iteration with let](https://github.com/Microsoft/TypeScript/issues/3915)).
19+
20+
To enable using Babel as the transpiler, make these changes to your `tsconfig.json` file:
21+
22+
**1:** Add this key in the root:
23+
24+
```js
25+
{
26+
"externalTranspiler": "babel"
27+
}
28+
```
29+
**2:** Set the `target` compiler option to `"es6"`. This is not *technically* required, but if you don't do this, you'll just be transpiling an already-transpiled file.
30+
31+
Note that atom-typescript's Babel integraion works with in concert with the `removeComments`, `sourceMap`, and `inlineSourceMap` compiler options settings in `tsconfig.json`, so those items should just work as expected. Any source maps should be doubly-mapped back to the original TypeScript.
32+
1733
## I prefer single (or double) quotes
1834
You can set that in the package settings https://atom.io/docs/latest/using-atom-atom-packages#package-settings
1935

0 commit comments

Comments
 (0)