Skip to content

rencire/typescript-babel-jest-starter

Repository files navigation

Typescript-Babel-Jest

Simple, barebones starter Typescript project with Jest setup.
Typescript compiler only used for code editing. Babel is solely responsible for transpilation.

To use:

git clone [email protected]:rencire/ts-babel-jest.git <your_project_name>

Manually install dependencies

Typescript

  • Initializes tsconfig.json with default options. Change as needed.
npm i -D [email protected]
npx tsc --init

Babel

npm i -D @babel/[email protected]
npm i -D @babel/[email protected]
npm i -D @babel/[email protected]
npm i -D @babel/[email protected]

Jest

  • Need babel-core@bridge so that jest can use the new @babel/core package.
  • Change options in jest.config.js as needed.
npm i -D @types/[email protected]
npm i -D [email protected]
npm i -D [email protected]
npx jest --init

tslint

npm i -D [email protected]
npx tslint --init

prettier

  • install tslint-config-prettier to disable conflicting rules between prettier and tslint. prettier takes care of formatting, while tslint takes care of all the rest.
  • Add "tslint-config-prettier" to tslint.json.

husky

lint-staged

Targeting browsers

Queries in .browserslistrc dictate which browsers babel should target when transpiling.

See browserslist for more details.

Resources