https://github.com/phatnguyenuit/react-typescript-template
My customized react typescript template
https://github.com/phatnguyenuit/react-typescript-template
eslint eslint-config-airbnb husk lint-staged prett reactjs typescript vscode
Last synced: 3 months ago
JSON representation
My customized react typescript template
- Host: GitHub
- URL: https://github.com/phatnguyenuit/react-typescript-template
- Owner: phatnguyenuit
- Created: 2020-02-22T15:16:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-22T15:21:54.000Z (about 5 years ago)
- Last Synced: 2025-01-10T14:58:36.531Z (4 months ago)
- Topics: eslint, eslint-config-airbnb, husk, lint-staged, prett, reactjs, typescript, vscode
- Language: TypeScript
- Homepage:
- Size: 194 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Typescript Template
## Boostraped by [create-react-app](https://www.npmjs.com/package/create-react-app)
## Features
- [x] Support absolute imports by using baseUrl in tsconfig.json
- [x] Integrate Prettier to reformat code styles
- [x] Configure ESlint with airbnb and supports: Typescript, React, React-Hooks, Prettier, Imports.
- [x] Configure lint-stage and husky to use pre-commit hook to prevent bad style code pushed to GitHub## Guides
- Copy dot files and tsconfig.json.
- Install devDependencies packages: `npm install --save-dev eslint @typescript-eslint/eslint-plugin eslint-config-airbnb eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks husky lint-staged prettier`
- Add new scripts:```json
"prettier": "prettier --write src/**/*.{ts,tsx}",
"lint-staged": "lint-staged",
"lint:ts": "eslint ./src --ext .ts,.tsx",
"lint:ts:fix": "npm run lint:ts -- --fix"
```- Add package.json options:
```json
"lint-staged": {
"src/**/*.{ts,tsx}": [ "eslint . --fix", "git add" ]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
```