Skip to content

Commit

Permalink
chore: TS로 변환
Browse files Browse the repository at this point in the history
- typescript 설치
- vite.config.ts. 파일로 바꾸기
- ts.config.josn, tsconfig.node.json 파일 수정
- vite-env.d.ts 파일 생성
- 파일 형식 .jsx에서 .tsx로 수정
  • Loading branch information
devhaeun committed Jan 19, 2025
1 parent f29f36a commit d05788a
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
16 changes: 14 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"eslint-plugin-react-refresh": "^0.4.16",
"globals": "^15.14.0",
"prettier": "^3.4.2",
"typescript": "^5.7.3",
"vite": "^6.0.5"
}
}
File renamed without changes.
4 changes: 2 additions & 2 deletions src/main.jsx → src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.jsx'
import App from './App.js'

createRoot(document.getElementById('root')).render(
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
21 changes: 21 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
9 changes: 9 additions & 0 deletions tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
File renamed without changes.

0 comments on commit d05788a

Please sign in to comment.