Skip to content

Commit

Permalink
메인 프로젝트 환경 세팅 (#2)
Browse files Browse the repository at this point in the history
* Env: Vite + TypeScript, 라이브러리 설치

* Env: EsLint + Prettier 설정

* Feat: 기본 라우터 설정

* Fix: Eslint 수정

* Env: Tanstack Query 환경설정

* Env: 폴더구조 및 라우터 설정

* Docs: Issue & PR Template 적용

* Docs: 템플릿 글자 수정

* Fix: Eslint config.ts 파일 인식 추가

* Fix: airbnb eslint delete
  • Loading branch information
KimKyuHoi authored Mar 30, 2024
1 parent 5f36832 commit 294fe74
Show file tree
Hide file tree
Showing 32 changed files with 3,872 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module",
"project": "./tsconfig.json",
"createDefaultProgram": true
},
"plugins": [
"@typescript-eslint",
"react",
"react-hooks",
"jsx-a11y",
"import",
"prettier"
],
"rules": {
"prettier/prettier": ["error"],
"no-param-reassign": ["error", { "props": false }],
"@typescript-eslint/no-non-null-assertion": "off",
"react/react-in-jsx-scope": "off"
}
}
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/ISSUE_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Issue request
about: 이슈추가 템플릿
title: ''
labels: ''
assignees: ''
---

## **Issue**

### ✨ 기능 리스트

---

### ✏ 사용 이유

---
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Pull Request
about: PR추가 템플릿
title: ''
labels: ''
assignees: ''
---

### ✨ 작업 내용

---

### ✨ 참고 사항

---

### ⏰ 현재 버그

---

### ✏ Git Close
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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?

.env
.env.local
.env.development.local
.env.test.local
.env.production.local
38 changes: 38 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "always",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleAttributePerLine": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false,

"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrder": [
"^react",
"<THIRD_PARTY_MODULES>",

"^(.)*(/)(components)(.*)$",
"^(.)*(/)(pages)(.*)$",
"^(.)*(/)(hooks)(.*)$",
"^(.)*(/)(assets)(.*)$",

"^(.)*(/)(constants)(.*)$|^(.)*(/)(utils)(.*)",

"^(.)*(/)(api)(.*)$",
"^(.)*(/)(store)(.*)$|^@reduxjs"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": false
}
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
# GDSC_Official-FE
GDSC 공식 홈페이지 프론트엔드 파트입니다.
# 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 {
// other rules...
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json", "./tsconfig.node.json"],
tsconfigRootDir: __dirname,
},
};
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<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" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
44 changes: 44 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "vite-project",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"format": "prettier --check --ignore-path .gitignore .",
"format:fix": "prettier --write --ignore-path .gitignore ."
},
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@tanstack/react-query": "^5.20.5",
"axios": "^1.6.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.0",
"zustand": "^4.5.0"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"prettier": "^3.2.5",
"typescript": "^5.3.3",
"vite": "^5.1.3"
}
}
Loading

0 comments on commit 294fe74

Please sign in to comment.