[x] replace common-js require with es6 modules. -- there is a little bit issue here with default exports of npm dependencies, some might require to be imported as import * as foo from 'foo'
[x] replace common-js module.exports with es6 module exports.
[x] upgrade prettier to ^1.4.1 for TypeScript support.
[x] use ts-node for running tests with mocha.
[ ] add module declarations via .d.ts files
[ ] replace all js files under /src folder with their ts equivalents.
This PR's main job is to replace babel with typescript's tsc compiler. As of version 1.8.0 TypeScript allows using JavaScript files via allowJs compiler option in tsconfig.json. Since TypeScript knows how to transpile ES6 code into ES5 code, this allows us to use TypeScript along side with JavaScript, providing a way for us to incrementally migrate to TypeScript.
Even though this changes how we write code, my aim is to keep the same public api 100%, once we merge this PR.
babel
withtsc
require
withes6
modules. -- there is a little bit issue here withdefault export
s of npm dependencies, some might require to be imported asimport * as foo from 'foo'
module.exports
withes6
module exports.prettier
to^1.4.1
forTypeScript
support.ts-node
for running tests with mocha..d.ts
filesjs
files under/src
folder with theirts
equivalents.This PR's main job is to replace
babel
with typescript'stsc
compiler. As of version1.8.0
TypeScript allows using JavaScript files viaallowJs
compiler option intsconfig.json
. Since TypeScript knows how to transpile ES6 code into ES5 code, this allows us to use TypeScript along side with JavaScript, providing a way for us to incrementally migrate to TypeScript.Even though this changes how we write code, my aim is to keep the same public api 100%, once we merge this PR.