Skip to content

Commit f889997

Browse files
authored
Merge pull request #122 from oodd-team/feat/OD-138
[OD-138] 전체 폴더구조 변경 & import문 적용
2 parents f399712 + 955321d commit f889997

151 files changed

Lines changed: 2207 additions & 859 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

Lines changed: 100 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,109 @@
11
module.exports = {
22
root: true,
3-
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:import/typescript',
7+
'plugin:import/recommended',
8+
'plugin:prettier/recommended',
9+
],
410
parser: '@typescript-eslint/parser',
5-
parserOptions: { project: ['./tsconfig.json'] },
6-
plugins: ['@typescript-eslint'],
11+
parserOptions: {
12+
project: ['./tsconfig.app.json', './tsconfig.node.json'],
13+
},
14+
plugins: ['@typescript-eslint', 'eslint-plugin-import'],
15+
settings: {
16+
'import/resolver': {
17+
typescript: {
18+
project: ['./tsconfig.app.json', './tsconfig.node.json'],
19+
},
20+
},
21+
'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx'] },
22+
},
23+
env: {
24+
node: true,
25+
},
726
rules: {
8-
'@typescript-eslint/strict-boolean-expressions': [
9-
2,
27+
'prettier/prettier': ['error', { endOfLine: 'auto' }],
28+
'import/extensions': [
29+
'error',
30+
'ignorePackages',
1031
{
11-
allowString: false,
12-
allowNumber: false,
32+
ts: 'never',
33+
tsx: 'never',
34+
},
35+
],
36+
'import/order': [
37+
'error',
38+
{
39+
groups: ['builtin', 'external', 'internal', 'index', 'type', 'parent', 'sibling', 'object'],
40+
alphabetize: {
41+
order: 'asc',
42+
caseInsensitive: true,
43+
},
44+
'newlines-between': 'always',
45+
pathGroups: [
46+
{
47+
pattern: 'react*',
48+
group: 'builtin',
49+
position: 'before',
50+
},
51+
{
52+
pattern: '@components/**/dto',
53+
group: 'type',
54+
},
55+
{
56+
pattern: '@styles/**',
57+
group: 'internal',
58+
position: 'before',
59+
},
60+
{
61+
pattern: '@assets/**',
62+
group: 'internal',
63+
position: 'after',
64+
},
65+
{
66+
pattern: '@components/Icons/**',
67+
group: 'internal',
68+
position: 'after',
69+
},
70+
{
71+
pattern: '@components/**',
72+
group: 'internal',
73+
position: 'after',
74+
},
75+
{
76+
pattern: '../**/dto',
77+
group: 'type',
78+
position: 'after',
79+
},
80+
{
81+
pattern: './**/dto',
82+
group: 'type',
83+
position: 'after',
84+
},
85+
{
86+
pattern: '../**/index',
87+
group: 'parent',
88+
position: 'before',
89+
},
90+
{
91+
pattern: './**/index',
92+
group: 'parent',
93+
position: 'before',
94+
},
95+
],
96+
pathGroupsExcludedImportTypes: ['react*'],
1397
},
1498
],
1599
},
16-
ignorePatterns: ['src/**/*.test.ts', 'src/frontend/generated/*'],
100+
overrides: [
101+
{
102+
files: ['*.ts', '*.tsx'],
103+
rules: {
104+
'import/order': 'error',
105+
},
106+
},
107+
],
108+
ignorePatterns: ['src/**/*.test.ts', 'src/frontend/generated/*', 'src/App.tsx'],
17109
};

.prettierrc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"trailingComma": "all",
3-
"tabWidth": 2,
4-
"semi": true,
5-
"singleQuote": true,
6-
"printWidth": 120,
7-
"arrowParens": "always",
8-
"useTabs": true
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"printWidth": 120,
7+
"arrowParens": "always",
8+
"useTabs": true
99
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@
3737
"@typescript-eslint/eslint-plugin": "^8.18.1",
3838
"@typescript-eslint/parser": "^8.18.1",
3939
"@vitejs/plugin-react": "^4.3.1",
40-
"eslint": "^9.17.0",
40+
"eslint": "^8.0.0",
4141
"eslint-config-prettier": "^9.1.0",
42+
"eslint-import-resolver-typescript": "^3.7.0",
43+
"eslint-plugin-import": "^2.31.0",
4244
"eslint-plugin-prettier": "^5.1.3",
4345
"eslint-plugin-react-hooks": "^5.1.0",
4446
"eslint-plugin-react-refresh": "^0.4.7",

src/App.tsx

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
import React from 'react';
22
import { BrowserRouter, Route, Routes, Navigate } from 'react-router-dom';
3-
import Home from './pages/Home';
4-
import Login from './pages/Login';
5-
import SignUp from './pages/SignUp';
6-
import LoginComplete from './pages/Login/LoginComplete';
7-
import TermsAgreement from './pages/TermsAgreement';
8-
9-
import Profile from './pages/Profile';
10-
import ProfileEdit from './pages/ProfileEdit';
11-
import AccountSetting from './pages/AccountSetting';
12-
import AccountEdit from './pages/AccountEdit';
13-
import AccountCancel from './pages/AccountCancel';
14-
import Verification from './pages/verification';
15-
16-
import Post from './pages/Post';
17-
import PostUpload from './pages/PostUpload';
18-
import PostImageSelect from './pages/PostImageSelect';
19-
import PostInstaConnect from './pages/PostInstaConnect';
20-
import PostInstaFeedSelect from './pages/PostInstaFeedSelect';
21-
22-
import Chats from './pages/Chats';
23-
import ChatRoom from './pages/Chats/ChatRoom';
24-
25-
import NotFound from './pages/NotFound';
3+
4+
import Home from '@pages/Home';
5+
import Login from '@pages/Login';
6+
import LoginComplete from '@pages/Login/LoginComplete';
7+
8+
import SignUp from '@pages/SignUp';
9+
import TermsAgreement from '@pages/SignUp/TermsAgreement';
10+
11+
import Profile from '@pages/Profile';
12+
import ProfileEdit from '@pages/Profile/ProfileEdit';
13+
14+
import AccountSetting from '@pages/Account/AccountSetting';
15+
import AccountEdit from '@pages/Account/AccountEdit';
16+
import AccountCancel from '@pages/Account/AccountCancel';
17+
import Verification from '@pages/Account/Verification';
18+
19+
import Post from '@pages/Post';
20+
import PostUpload from '@pages/Post/PostUpload';
21+
import PostImageSelect from '@pages/Post/PostImageSelect';
22+
import PostInstaConnect from '@pages/Post/PostInstaConnect';
23+
import PostInstaFeedSelect from '@pages/Post/PostInstaFeedSelect';
24+
25+
import Chats from '@pages/Chats';
26+
import ChatRoom from '@pages/Chats/ChatRoom';
27+
28+
import NotFound from '@pages/NotFound';
2629

2730
const ProtectedRoute = ({ children }: { children: JSX.Element }) => {
2831
const isAuthenticated = Boolean(localStorage.getItem('new_jwt_token'));
@@ -33,19 +36,21 @@ const ProtectedRoute = ({ children }: { children: JSX.Element }) => {
3336
const protectedRoutes = [
3437
{ path: '/', element: <Home /> },
3538

36-
// 사용자 프로필 및 계정 관리
39+
// profile
3740
{ path: '/profile/:userId', element: <Profile /> },
3841
{ path: '/profile/edit', element: <ProfileEdit /> },
39-
{ path: '/account-setting', element: <AccountSetting /> },
40-
{ path: '/account-edit', element: <AccountEdit /> },
41-
{ path: '/account-cancel', element: <AccountCancel /> },
42-
{ path: '/verification', element: <Verification /> },
42+
43+
// account
44+
{ path: '/account/setting', element: <AccountSetting /> },
45+
{ path: '/account/edit', element: <AccountEdit /> },
46+
{ path: '/account/cancel', element: <AccountCancel /> },
47+
{ path: '/account/verification', element: <Verification /> },
4348

4449
{ path: '/post/:postId', element: <Post /> },
45-
{ path: '/upload', element: <PostUpload /> },
46-
{ path: '/image-select', element: <PostImageSelect /> },
47-
{ path: '/insta-connect', element: <PostInstaConnect /> },
48-
{ path: '/insta-feed-select', element: <PostInstaFeedSelect /> },
50+
{ path: '/post/upload/photo/select', element: <PostImageSelect /> },
51+
{ path: '/post/upload/instagram/connect', element: <PostInstaConnect /> },
52+
{ path: '/post/upload/instagram/select', element: <PostInstaFeedSelect /> },
53+
{ path: '/post/upload/content', element: <PostUpload /> },
4954

5055
// 메시지/채팅
5156
{ path: '/chats', element: <Chats /> },

src/apis/util/handleError.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AxiosError } from 'axios';
2+
23
import { ApiDomain, errorMessages } from './errorMessage';
34

45
export const handleError = (error: unknown, domain: ApiDomain = 'default') => {

src/components/BottomButton/dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export interface BottomButtonProps {
2-
content: String;
2+
content: string;
33
onClick: () => void;
44
disabled?: boolean;
55
}

src/components/BottomButton/index.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import React from 'react';
1+
import { StyledText } from '@components/Text/StyledText';
2+
3+
import type { BottomButtonProps } from './dto';
4+
25
import { ButtonWrapper, Button } from './styles';
3-
import { StyledText } from '../Text/StyledText';
4-
import { BottomButtonProps } from './dto';
56

67
const BottomButton: React.FC<BottomButtonProps> = ({ content, onClick, disabled = false }) => {
78
return (
8-
<>
9-
<ButtonWrapper>
10-
<Button onClick={onClick} disabled={disabled}>
11-
<StyledText $textTheme={{ style: 'body1-regular', lineHeight: 2 }}>{content}</StyledText>
12-
</Button>
13-
</ButtonWrapper>
14-
</>
9+
<ButtonWrapper>
10+
<Button onClick={onClick} disabled={disabled}>
11+
<StyledText $textTheme={{ style: 'body1-regular', lineHeight: 2 }}>{content}</StyledText>
12+
</Button>
13+
</ButtonWrapper>
1514
);
1615
};
1716

src/components/BottomButton/styles.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import styled from 'styled-components';
1+
import { styled } from 'styled-components';
22

33
export const ButtonWrapper = styled.div`
44
display: flex;
@@ -15,8 +15,9 @@ export const ButtonWrapper = styled.div`
1515
`;
1616

1717
export const Button = styled.button<{ disabled: boolean }>`
18-
background: ${({ disabled, theme }) => //theme에 없어서 그냥 뒀음
19-
disabled ? 'linear-gradient(93deg, #FFC1D6 1.22%, #F8D4D4 99.73%)' : theme.colors.brand.gradient};
18+
background: ${(
19+
{ disabled, theme }, //theme에 없어서 그냥 뒀음
20+
) => (disabled ? 'linear-gradient(93deg, #FFC1D6 1.22%, #F8D4D4 99.73%)' : theme.colors.brand.gradient)};
2021
border-radius: 0.625rem;
2122
font-size: 1rem;
2223
width: calc(100% - 2.5rem);
File renamed without changes.

src/components/BottomSheetMenu/index.tsx renamed to src/components/BottomSheet/BottomSheetMenu/index.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
import { memo } from 'react';
2+
3+
import theme from '@styles/theme';
4+
15
import { StyledText } from '@components/Text/StyledText';
2-
import { BottomSheetMenuLayout, SheetItem, IconButton } from './styles';
6+
37
import type { BottomSheetMenuProps, SheetItemDto } from './dto';
4-
import React from 'react';
5-
import theme from '@styles/theme';
68

7-
const BottomSheetMenu: React.FC<BottomSheetMenuProps> = React.memo(({ items }) => {
9+
import { BottomSheetMenuLayout, SheetItem, IconButton } from './styles';
10+
11+
const BottomSheetMenu: React.FC<BottomSheetMenuProps> = memo(({ items }) => {
812
return (
913
<BottomSheetMenuLayout>
1014
{items.map((item: SheetItemDto, index) => (

0 commit comments

Comments
 (0)