-
Notifications
You must be signed in to change notification settings - Fork 10
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
[4주차] 권혜인 과제 제출합니다. #12
base: master
Are you sure you want to change the base?
Changes from 179 commits
fc012ac
0060c53
fc99170
0dcbcfc
e1839b5
aaeb7a5
af6fecd
aaf1811
3d39587
73311cb
fe1b76e
84752ad
5cd5c55
862e6eb
0e0836a
bfc8177
c74eaca
894b63c
259d180
64e998b
8bda3d4
5a1a49f
03078dd
d9a38fa
532690f
b77f065
25f0a07
c5fd7c7
6a87fa8
8bbea63
aed438e
b228901
c9c5632
48aa199
d9e3c8e
be1f98a
5e0dc64
838edda
8611d7e
c479437
db515ba
5623adf
ab418fb
a0df8d5
57484e9
dfebd2c
9bf4f65
cbfa671
d6b119e
96b75d5
d5dc8b1
f73bdbb
477f728
7d56488
3fe77da
88d01e1
b5d5665
00c06d2
2690e0a
c5ec78b
f7bc58f
b7dd55c
aae7e7d
d93cbb2
9b14de4
03a44db
6ab048b
08557b1
f00f985
d6e53d7
fe82bbb
c59c2c5
4b5be71
80e0abf
d4a6624
56eea35
1c4e456
2258635
8271b73
03e48d7
2223034
9ba4def
22b2cfa
0af4b3d
361dc3f
61ac76e
607cb36
646924a
bf52457
799d675
13f0d24
1ed299f
d1c26d3
bab3a58
8ed2b4b
75a6f30
7cfd334
2462833
996b793
b572f58
126d283
b4feb99
8689ed1
6702acd
5ae97ee
683bbf9
8a8abad
7360fb7
633a2b7
7e41c97
9630567
8fcc7c1
9abba71
b95fe07
ae95cb7
c7a3915
5c57cd9
7398379
dc2a3ce
b438ef5
6d210a2
241ca06
6e42e8e
f7a63ad
31d58dc
620a179
3e16db8
d9f3421
83f60f9
f3defe0
7c4ab9b
862d972
bcc5fc8
9013d63
d48b573
abb5f65
7f48dd0
837dcf0
c0fce50
eec2561
2edec8c
1433f31
7956d1e
ba21bc6
64b6ee3
8e540d1
a8a9b2b
8d70bf9
d5a9668
9959040
1dc7d9f
dabed75
fa824bd
7e706f9
8a2c0eb
4912b30
cb7dd59
9455530
b24c719
37e5912
2b8be33
61aa4d9
ef7bc6f
c3c388d
d3f5afd
e9ad643
dfb8eac
9020406
ddb7e57
b8de14c
d7e6b3e
b3255dc
2cfa0f8
49b1ffe
5378e14
2c1f3c0
8195856
a247478
bf1401c
1517d89
2b7bc6a
3eda5b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint", "prettier"], | ||
extends: [ | ||
"eslint:recommended", | ||
"eslint-config-prettier", | ||
"airbnb", | ||
"plugin:import/errors", | ||
"plugin:import/warnings", | ||
"plugin:prettier/recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier/@typescript-eslint", | ||
], | ||
ignorePatterns: ["dist", ".eslintrc.cjs"], | ||
rules: { | ||
"linebreak-style": 0, | ||
"import/prefer-default-export": 0, | ||
"prettier/prettier": 0, | ||
"import/extensions": 0, | ||
"import/no-unresolved": 0, | ||
"import/no-extraneous-dependencies": 0, // 테스트 또는 개발환경을 구성하는 파일에서는 devDependency 사용을 허용 | ||
"react/prop-types": 0, | ||
"react/jsx-filename-extension": [2, { extensions: [".js", ".jsx", ".ts", ".tsx"] }], | ||
"jsx-a11y/no-noninteractive-element-interactions": 0, | ||
"eol-last": ["error", "always"], // line의 가장 마지막 줄에는 개행 넣기" | ||
"simple-import-sort/imports": "error", // import 정렬 | ||
"no-multi-spaces": "error", // 스페이스 여러개 금지 | ||
Comment on lines
+23
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. import를 저는 수동으로 구분해서 정렬해주었는데 eslint 설정을 잘 활용하신 것 같아요!! 저도 다음에 써봐야겠습니당👍 |
||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"semi": true, | ||
"tabWidth": 2, | ||
"printWidth": 120, | ||
"trailingComma": "all", | ||
"bracketSameLine": true, | ||
"endOfLine": "auto" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": ["stylelint-config-standard", "stylelint-config-clean-order"], | ||
"customSyntax": "postcss-styled-syntax" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# React + TypeScript + Vite | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
|
||
Currently, two official plugins are available: | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
|
||
## Expanding the ESLint configuration | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
|
||
- Configure the top-level `parserOptions` property like this: | ||
|
||
```js | ||
export default tseslint.config({ | ||
languageOptions: { | ||
// other options... | ||
parserOptions: { | ||
project: ['./tsconfig.node.json', './tsconfig.app.json'], | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
}) | ||
``` | ||
|
||
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` | ||
- Optionally add `...tseslint.configs.stylisticTypeChecked` | ||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: | ||
|
||
```js | ||
// eslint.config.js | ||
import react from 'eslint-plugin-react' | ||
|
||
export default tseslint.config({ | ||
// Set the react version | ||
settings: { react: { version: '18.3' } }, | ||
plugins: { | ||
// Add the react plugin | ||
react, | ||
}, | ||
rules: { | ||
// other rules... | ||
// Enable its recommended rules | ||
...react.configs.recommended.rules, | ||
...react.configs['jsx-runtime'].rules, | ||
}, | ||
}) | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import js from '@eslint/js' | ||
import globals from 'globals' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import reactRefresh from 'eslint-plugin-react-refresh' | ||
import tseslint from 'typescript-eslint' | ||
|
||
export default tseslint.config( | ||
{ ignores: ['dist'] }, | ||
{ | ||
extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
files: ['**/*.{ts,tsx}'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: globals.browser, | ||
}, | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html lang="ko"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> | ||
<title>Messanger</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "ceos", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc -b && vite build", | ||
"lint": "eslint .", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@types/node": "^22.6.1", | ||
"path": "^0.12.7", | ||
"postcss-styled-syntax": "^0.6.4", | ||
"prettier": "^3.3.3", | ||
"react": "^18.3.1", | ||
"react-device-detect": "^2.2.3", | ||
"react-dom": "^18.3.1", | ||
"react-router": "^6.26.2", | ||
"react-router-dom": "^6.26.2", | ||
"styled-components": "^6.1.13", | ||
"styled-reset": "^4.5.2", | ||
"stylelint": "^16.9.0", | ||
"stylelint-config-clean-order": "^6.1.0", | ||
"stylelint-config-standard": "^36.0.1", | ||
"vite-tsconfig-paths": "^5.0.1", | ||
"zustand": "^5.0.0-rc.2" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.9.0", | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"@vitejs/plugin-react": "^4.3.1", | ||
"eslint": "^9.11.1", | ||
"eslint-plugin-react-hooks": "^5.1.0-rc.0", | ||
"eslint-plugin-react-refresh": "^0.4.9", | ||
"globals": "^15.9.0", | ||
"typescript": "^5.5.3", | ||
"typescript-eslint": "^8.0.1", | ||
"vite": "^5.4.1", | ||
"vite-plugin-svgr": "^4.2.0" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ThemeProvider } from "styled-components"; | ||
import theme from "./style/theme"; | ||
import { GlobalStyle } from "./style/globalStyle"; | ||
import { router } from "routes/router"; | ||
import { RouterProvider } from "react-router-dom"; | ||
|
||
function App() { | ||
return ( | ||
<ThemeProvider theme={theme}> | ||
<RouterProvider router={router} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저는 기존에 browserRouter로 감싸고 경로를 설정하는 식으로 썼는데 찾아보니 RouterProvider가 v6.4에 추가된 방식이군요..! 아래쪽 router 정의해주신 부분 보니 children 옵션에 중첩 라우팅을 추가해주신 부분까지 정말 잘 쓰신 것 같아요 👍❤️🔥 |
||
<GlobalStyle /> | ||
</ThemeProvider> | ||
); | ||
} | ||
|
||
export default App; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare module "*.ttf"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint적용 정말 적절히 잘해주신 것 같아요! 많이 배워갈게요