Skip to content

Commit 9deae94

Browse files
js to ts
1 parent 1699718 commit 9deae94

10 files changed

+148
-189
lines changed

package-lock.json

Lines changed: 100 additions & 177 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
"private": true,
55
"homepage": "https://db-man.github.io",
66
"dependencies": {
7-
"@db-man/components": "^0.1.121",
8-
"@testing-library/jest-dom": "^5.16.4",
9-
"@testing-library/react": "^13.2.0",
10-
"@testing-library/user-event": "^14.1.1",
7+
"@db-man/components": "^0.1.122",
8+
"@testing-library/jest-dom": "^5.17.0",
9+
"@testing-library/react": "^13.4.0",
10+
"@testing-library/user-event": "^13.5.0",
11+
"@types/jest": "^27.5.2",
12+
"@types/node": "^16.18.106",
13+
"@types/react": "^18.3.5",
14+
"@types/react-dom": "^18.3.0",
1115
"antd": "^5.7.0",
12-
"react": "^18.1.0",
13-
"react-dom": "^18.1.0",
16+
"react": "^18.3.1",
17+
"react-dom": "^18.3.1",
1418
"react-scripts": "5.0.1",
19+
"typescript": "^4.9.5",
1520
"web-vitals": "^2.1.4"
1621
},
1722
"scripts": {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import { render, screen } from '@testing-library/react';
23
import App from './App';
34

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import logo from './logo.svg';
23
import './App.css';
34

@@ -7,7 +8,7 @@ function App() {
78
<header className="App-header">
89
<img src={logo} className="App-logo" alt="logo" />
910
<p>
10-
Edit <code>src/App.js</code> and save to reload.
11+
Edit <code>src/App.tsx</code> and save to reload.
1112
</p>
1213
<a
1314
className="App-link"
File renamed without changes.

src/index.js renamed to src/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom/client';
33
import './index.css';
4-
import App from './App/index.jsx';
4+
import App from './App/index';
55
import reportWebVitals from './reportWebVitals';
66

7-
const root = ReactDOM.createRoot(document.getElementById('root'));
8-
root.render(
9-
<App />
7+
const root = ReactDOM.createRoot(
8+
document.getElementById('root') as HTMLElement
109
);
10+
root.render(<App />);
1111

1212
// If you want to start measuring performance in your app, pass a function
1313
// to log results (for example: reportWebVitals(console.log))

src/react-app-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="react-scripts" />

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

Lines changed: 3 additions & 1 deletion
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

Lines changed: 26 additions & 0 deletions
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)