Skip to content

Commit 0f98370

Browse files
authored
refactor: tweak tsconfig.json and import paths (#59)
1 parent 56e8070 commit 0f98370

File tree

6 files changed

+8
-19
lines changed

6 files changed

+8
-19
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"@vitejs/plugin-react": "4.2.1",
1919
"prettier": "3.2.5",
2020
"typescript": "5.4.5",
21-
"vite": "5.2.9",
22-
"vite-tsconfig-paths": "4.3.2"
21+
"vite": "5.2.9"
2322
}
2423
}

src/components/FriendRequestForm/FriendRequestForm.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
2-
import { UserList } from 'src/components/UserList/UserList'
1+
import { UserList } from '../UserList/UserList'
32
import styles from './FriendRequestForm.module.css'
43

5-
const FriendRequestForm = () => {
4+
export const FriendRequestForm = () => {
65
return (
76
<form className={styles.wrapper}>
87
<h2 className={styles.header}>友達リクエストの送信先を選択してください</h2>
@@ -17,5 +16,3 @@ const FriendRequestForm = () => {
1716
</form>
1817
)
1918
}
20-
21-
export { FriendRequestForm }

src/components/UserList/UserList.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
// Data Source
22
import { users } from '../../data/users'
3-
import { getUsers } from 'src/data/getUsers'
3+
import { getUsers } from '../../data/getUsers'
44

55
// CSS Modules
66
import styles from './UserList.module.css'
77
// styled-components
88
import styled from 'styled-components'
99

10-
const UserList = () => {
10+
export const UserList = () => {
1111
return <>TODO: ユーザーリストの実装</>
1212
}
13-
14-
export { UserList }

src/main.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ReactDOM from 'react-dom/client'
33

44
import 'ress'
55

6-
import { FriendRequestForm } from 'src/components/FriendRequestForm/FriendRequestForm'
6+
import { FriendRequestForm } from './components/FriendRequestForm/FriendRequestForm'
77

88
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
99
<React.StrictMode>

tsconfig.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
"isolatedModules": true,
1919
"jsx": "react-jsx",
2020
"allowSyntheticDefaultImports": true,
21-
"noFallthroughCasesInSwitch": true,
22-
"paths": {
23-
"src/*": ["./src/*"],
24-
}
21+
"noFallthroughCasesInSwitch": true
2522
},
2623
"exclude": ["node_modules"],
2724
"include": ["**/*.ts", "**/*.tsx"]

vite.config.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { defineConfig } from 'vite'
2-
import tsconfigPaths from 'vite-tsconfig-paths'
32
import react from '@vitejs/plugin-react'
43

5-
64
export default defineConfig({
7-
plugins: [react(), tsconfigPaths()],
5+
plugins: [react()],
86
})

0 commit comments

Comments
 (0)