Skip to content

Commit d3e3c59

Browse files
committed
Updating the TypeScript.
1 parent c490f2f commit d3e3c59

9 files changed

+1004
-3910
lines changed

package-lock.json

+967-3,905
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@
1717
"@testing-library/jest-dom": "^5.16.2",
1818
"@testing-library/react": "^12.1.3",
1919
"@testing-library/user-event": "^13.5.0",
20+
"@types/date-fns": "^2.6.0",
21+
"@types/jest": "^27.4.1",
22+
"@types/node": "^16.11.25",
23+
"@types/react": "^17.0.39",
24+
"@types/react-dom": "^17.0.11",
2025
"react": "^17.0.2",
2126
"react-dom": "^17.0.2",
2227
"react-scripts": "5.0.0",
28+
"typescript": "^4.5.5",
2329
"web-vitals": "^2.1.4"
2430
},
25-
"devDependencies": {
26-
"@types/date-fns": "^2.6.0"
27-
},
2831
"eslintConfig": {
2932
"extends": [
3033
"react-app",
File renamed without changes.

src/App.js renamed to src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function App() {
77
<header className="App-header">
88
<img src={logo} className="App-logo" alt="logo" />
99
<p>
10-
Edit <code>src/App.js</code> and save to reload.
10+
Edit <code>src/App.tsx</code> and save to reload.
1111
</p>
1212
<a
1313
className="App-link"
File renamed without changes.

src/react-app-env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="react-scripts" />

src/reportWebVitals.js renamed to src/reportWebVitals.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
const reportWebVitals = onPerfEntry => {
1+
import { ReportHandler } from 'web-vitals';
2+
3+
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
24
if (onPerfEntry && onPerfEntry instanceof Function) {
35
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
46
getCLS(onPerfEntry);
File renamed without changes.

tsconfig.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
9+
"allowJs": true,
10+
"skipLibCheck": true,
11+
"esModuleInterop": true,
12+
"allowSyntheticDefaultImports": true,
13+
"strict": true,
14+
"forceConsistentCasingInFileNames": true,
15+
"noFallthroughCasesInSwitch": true,
16+
"module": "esnext",
17+
"moduleResolution": "node",
18+
"resolveJsonModule": true,
19+
"isolatedModules": true,
20+
"noEmit": true,
21+
"jsx": "react-jsx"
22+
},
23+
"include": [
24+
"src"
25+
]
26+
}

0 commit comments

Comments
 (0)