https://github.com/rencire/typescript-babel-jest-starter
https://github.com/rencire/typescript-babel-jest-starter
babel babel7 browserslist husky jest lint-staged tslint typescript typescript3
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rencire/typescript-babel-jest-starter
- Owner: rencire
- Created: 2018-07-31T00:42:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-31T00:51:39.000Z (about 7 years ago)
- Last Synced: 2025-01-09T18:56:24.079Z (9 months ago)
- Topics: babel, babel7, browserslist, husky, jest, lint-staged, tslint, typescript, typescript3
- Language: JavaScript
- Size: 59.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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 git@github.com:rencire/ts-babel-jest.git
```## Manually install dependencies
### Typescript
- Initializes `tsconfig.json` with default options. Change as needed.
```
npm i -D typescript@3.0.1
npx tsc --init
```### Babel
```
npm i -D @babel/cli@7.0.0-beta.55
npm i -D @babel/core@7.0.0-beta.55
npm i -D @babel/preset-env@7.0.0-beta.55
npm i -D @babel/preset-typescript@7.0.0-beta.55
```### 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/jest@23.3.1
npm i -D jest@23.4.2
npm i -D babel-core@7.0.0-bridge.0
npx jest --init
```### tslint
```
npm i -D tslint@5.11.0
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`.```
npm i -D prettier@1.14.0
npm i -D tslint-config-prettier@1.14.0
```### husky
```
npm i -D husky@1.0.0-rc.13
```### lint-staged
```
npm i -D lint-staged@7.2.0
```### Targeting browsers
Queries in `.browserslistrc` dictate which browsers babel should target when transpiling.
See [browserslist](https://github.com/browserslist/browserslist) for more details.
# Resources
- https://github.com/Microsoft/TypeScript
- https://github.com/palantir/tslint
- https://github.com/prettier/prettier
- https://github.com/alexjoverm/tslint-config-prettier
- https://github.com/typicode/husky
- https://github.com/okonet/lint-staged