|
1 | | -# React (v16+) Typescript boilerplate with full setup for ESLint and Prettier |
| 1 | +# Typescript React project boilerplate with ESLint and Prettier |
2 | 2 |
|
3 | | -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
| 3 | +Starting point for a Typescript React project with full setup of SASS/SCSS, ESLint and Prettier for linting and formatting. |
4 | 4 |
|
5 | | -## Available Scripts |
| 5 | +## Stack |
| 6 | + |
| 7 | +This project is initialized with [Create React App](https://github.com/facebook/create-react-app) consisting of: |
| 8 | + |
| 9 | +- TypeScript |
| 10 | +- React (16+) |
| 11 | +- react-scripts (createReactApp) |
| 12 | +- react-testing-library (not Enzyme) |
| 13 | +- SASS/SCSS |
| 14 | +- ESLint (instead of deprecated TSLint) |
| 15 | +- Prettier |
| 16 | + |
| 17 | +## Get Started |
| 18 | + |
| 19 | +### Make sure you run Node.js v10+ |
| 20 | + |
| 21 | +To install check ([Node.js installation](https://nodejs.org/en/) or [Node Version Manager installation](https://github.com/nvm-sh/nvm)). |
| 22 | + |
| 23 | +### Clone or copy this repo |
| 24 | + |
| 25 | +```bash |
| 26 | +curl -L https://github.com/michielbouw/react-typescript-eslint-prettier-boilerplate/archive/master.zip | tar zx |
| 27 | +mv react-typescript-eslint-prettier-boilerplate APP_NAME && cd APP_NAME |
| 28 | +``` |
| 29 | + |
| 30 | +or |
| 31 | + |
| 32 | +```bash |
| 33 | +git clone git@github.com:michielbouw/react-typescript-eslint-prettier-boilerplate.git APP_NAME |
| 34 | +``` |
| 35 | + |
| 36 | +### `yarn install` (or `npm install`) |
| 37 | + |
| 38 | +Note: this project is initialized with [Yarn]() and it's recommended to use it,<br> |
| 39 | +but instead you could also use `npm` for all scripts and please remove the yarn.lock file if you do so. |
| 40 | + |
| 41 | +## Development Scripts |
6 | 42 |
|
7 | 43 | In the project directory, you can run: |
8 | 44 |
|
9 | | -### `yarn start` |
| 45 | +### `yarn start` (or `npm start`) |
10 | 46 |
|
11 | | -Runs the app in the development mode.<br /> |
| 47 | +Runs the app in the development mode.<br> |
12 | 48 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
13 | 49 |
|
14 | | -The page will reload if you make edits.<br /> |
| 50 | +The page will reload if you make edits.<br> |
15 | 51 | You will also see any lint errors in the console. |
16 | 52 |
|
17 | | -### `yarn test` |
| 53 | +### `yarn typecheck` (or `npm run typecheck`) |
18 | 54 |
|
19 | | -Launches the test runner in the interactive watch mode.<br /> |
20 | | -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. |
| 55 | +Launches the typescript check for code to check for TypeScript compilation errors or warnings. |
21 | 56 |
|
22 | | -### `yarn build` |
| 57 | +### `yarn lint` (or `npm run lint`) |
23 | 58 |
|
24 | | -Builds the app for production to the `build` folder.<br /> |
25 | | -It correctly bundles React in production mode and optimizes the build for the best performance. |
| 59 | +Launches the linter for code to check for code layout errors or warnings. |
26 | 60 |
|
27 | | -The build is minified and the filenames include the hashes.<br /> |
28 | | -Your app is ready to be deployed! |
| 61 | +### `yarn lint:fix` (or `npm run lint:fix`) |
29 | 62 |
|
30 | | -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
| 63 | +Launches the linter for code to check for code layout errors or warnings, and fixes the ones that can be fixed automatically. |
31 | 64 |
|
32 | | -### `yarn eject` |
| 65 | +### `yarn test` (or `npm run test`) |
33 | 66 |
|
34 | | -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** |
| 67 | +Launches the test runner in the interactive watch mode.<br> |
| 68 | +See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. |
35 | 69 |
|
36 | | -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. |
| 70 | +## Production Scripts |
37 | 71 |
|
38 | | -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. |
| 72 | +### `yarn build` (or `npm run build`) |
39 | 73 |
|
40 | | -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. |
| 74 | +Builds the app for production to the build folder.<br> |
| 75 | +It correctly bundles React in production mode and optimizes the build for the best performance. |
| 76 | + |
| 77 | +The build is minified and the filenames include the hashes.<br> |
| 78 | +Your app is ready to be deployed! |
| 79 | + |
| 80 | +See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
41 | 81 |
|
42 | 82 | ## Learn More |
43 | 83 |
|
|
0 commit comments