Skip to content

Commit d1ebad2

Browse files
committed
TypeScript check
1 parent c88e26b commit d1ebad2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

20211008/react/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,22 @@ npx tsc --init
5656
}
5757
```
5858

59+
`pacakge.json` 파일에 `check` 명령 추가:
60+
61+
```json
62+
{
63+
"scripts": {
64+
"check": "tsc --noEmit"
65+
}
66+
}
67+
```
68+
69+
TypeScript 컴파일 검사:
70+
71+
```bash
72+
npm run check
73+
```
74+
5975
### ESLint 세팅
6076

6177
```bash
@@ -177,6 +193,7 @@ module.exports = {
177193
```json
178194
{
179195
"scripts": {
196+
// ...(전략)...
180197
"lint": "eslint --fix --ext .js,.jsx,.ts,.tsx src"
181198
}
182199
}
@@ -259,7 +276,7 @@ module.exports = {
259276
};
260277
```
261278

262-
`src/App.tsx` 파일 작성:
279+
`src/App.test.tsx` 파일 작성:
263280

264281
```tsx
265282
import { render } from '@testing-library/react';

20211008/react/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"start": "parcel index.html --port 8080",
8+
"check": "tsc --noEmit",
89
"lint": "eslint --fix --ext .js,.jsx,.ts,.tsx src",
910
"test": "jest"
1011
},

0 commit comments

Comments
 (0)