Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11팀 장원정] [Chapter 2-2] 디자인 패턴과 함수형 프로그래밍 #41

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
81e6f0e
chore: eslint, pretiier 설정
Jan 12, 2025
396e89c
refacotr: FSD 아키텍처 기존 컴포넌트 구조로 1차 분류
Jan 13, 2025
2f765a0
fix: hooks import 오류 수정
Jan 13, 2025
939bf27
refactor: FSD eslint 규칙 추가 및 main.tsx, App.tsx app 레이어 폴더로 이동
Jan 13, 2025
28504d8
refactor: shared -> ui -> typography 폴더 생성 및 PageTitle, SectionTitle …
Jan 13, 2025
bf1aa46
refactor: 훅들 및 cart.ts 작성 완료, 기본 과제 테스트 완료
Jan 13, 2025
fbc6933
refacotr: CartPage -> CartList, ProductList로 분할
Jan 14, 2025
d494504
refactor: 기존 features에 있는 파일들 widgets로 옮김.
Jan 15, 2025
a83a0f9
refactor: shared에 공통 유틸 함수 및 컴포넌트 작성
Jan 15, 2025
dfa46f4
refactor: widgets에 있는 UI 컴포넌트 분할하여 features에 생성, shared에 전역 타입 생성, 전역…
Jan 15, 2025
04c0298
refactor: 기존 UI 컴포넌트들 features 레이어까지 분할
Jan 15, 2025
91552fb
refactor: Layout 컴포넌트 수정 및 app 레이어로 이동
Jan 15, 2025
cfcd45a
refactor: 전역 타입 app -> shared로 이동
Jan 15, 2025
a254412
refacotr: useCart, useCoupons, useProduct -> ContextAPI로 컴포넌트에서 전달 받을…
Jan 16, 2025
e51d8e3
refactor: 기존 useCart에서 쿠폰 선택 및 총액 계산 로직 useCartTotal로 분리
Jan 16, 2025
e63d6ec
refactor: useCart, useCartTotal -> entities로 이동
Jan 16, 2025
0f4d4c5
refacotr: shared에 Select 컴포넌트 생성 및 적용
Jan 16, 2025
243337a
refactor: features 레이어 컴포넌트 내부 함수 lib로 이동
Jan 16, 2025
4584499
refactor: Product 컴포넌트 생성, test 코드 수정
Jan 16, 2025
dd83841
refactor: ProductManagement 컴포넌트 분리, useDiscounts 훅 생성, useProduct에 f…
Jan 16, 2025
feea5d0
refacotr: 기존 ContextProvider들 수정
Jan 16, 2025
48f289f
refactor: EditingProductContextProvider 생성
Jan 16, 2025
d10f28b
refactor: DiscountView 컴포넌트 분리
Jan 16, 2025
8f73e12
refacotr: DiscountView key 추가
Jan 16, 2025
5e5eef3
fix: advanced.test.tsx 오류 수정
Jan 16, 2025
78b1de6
fix: 의존성 충돌 해결
Jan 17, 2025
b477a81
fix: lint 의존성 문제 해결
Jan 17, 2025
7579172
fix: lint airbnb fsd 관련 플러그인 삭제
Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .eslintrc.cjs

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 2
}
73 changes: 73 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import typescript from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import a11y from 'eslint-plugin-jsx-a11y';
import vitest from 'eslint-plugin-vitest';
import prettier from 'eslint-plugin-prettier';
import importPlugin from 'eslint-plugin-import';

export default [
{
files: ['*.ts', '*.tsx'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: ['./tsconfig.json'],
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': typescript,
react,
'react-hooks': reactHooks,
'jsx-a11y': a11y,
vitest,
prettier,
import: importPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
'react/react-in-jsx-scope': 'off',
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
'react/function-component-definition': [
'error',
{
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/explicit-function-return-type': 'off',
'import/prefer-default-export': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'jsx-a11y/anchor-is-valid': 'off',
},
},
{
files: ['*.test.{ts,tsx}'],
plugins: {
vitest,
},
rules: {
'vitest/no-disabled-tests': 'warn',
'vitest/no-focused-tests': 'error',
'vitest/no-identical-title': 'error',
},
},
{
ignores: ['dist/', 'node_modules/'],
},
];
2 changes: 1 addition & 1 deletion index.refactoring.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</head>
<body class="bg-gray-100 p-8">
<div id="root"></div>
<script type="module" src="/src/refactoring/main.tsx"></script>
<script type="module" src="/src/refactoring/app/index.tsx"></script>
</body>
</html>
19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test:advanced": "vitest src/advanced",
"test:ui": "vitest --ui",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
"lint": "eslint . --report-unused-disable-directives --max-warnings 0"
},
"dependencies": {
"react": "^18.3.1",
Expand All @@ -24,13 +24,22 @@
"@testing-library/user-event": "^14.5.2",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^8.10.0",
"@typescript-eslint/parser": "^8.10.0",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.20.0",
"@vitejs/plugin-react-swc": "^3.7.1",
"@vitest/ui": "^2.1.3",
"eslint": "^9.12.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.12",
"eslint-plugin-testing-library": "^6.5.0",
"eslint-plugin-vitest": "^0.5.4",
"jsdom": "^26.0.0",
"prettier": "^3.4.2",
"typescript": "^5.6.3",
"vite": "^5.4.9",
"vitest": "^2.1.3"
Expand Down
Loading
Loading