n-riesco / jp-babel

jp-babel is a babel kernel for the Jupyter notebook
Other
86 stars 16 forks source link

Support typescript #21

Closed pbadenski closed 4 years ago

pbadenski commented 4 years ago

At the moment jp-babel doesn't work with TypeScript since babel does not by default include ".ts" in supported filename extensions (https://babeljs.io/docs/en/babel-core#default_extensions).

Additionally babel uses filename extensions to decide which presets should be enabled for a file and that was also not working.

We include to additional flags for jp-babel:

This pull request combines all changes we did for our project to make jp-babel work.

This should also work for any other languages that babel can transpile, which are not enabled in babel by default.

//cc @robh1

n-riesco commented 4 years ago

@pbadenski Thank your for all the work on this PR and this review. But, since setting allExtensions to true seems to do the trick, I prefer this option over having more code to maintain.

I'd certainly welcome a PR to document your use of jp-babel and Typescript.