Skip to content

Commit 6d25920

Browse files
committed
project init
0 parents  commit 6d25920

15 files changed

+6492
-0
lines changed

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.prettierrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"arrowParens": "always",
3+
"htmlWhitespaceSensitivity": "css",
4+
"bracketSameLine": true,
5+
"bracketSpacing": true,
6+
"printWidth": 80,
7+
"proseWrap": "preserve",
8+
"quoteProps": "as-needed",
9+
"semi": true,
10+
"singleQuote": true,
11+
"tabWidth": 2,
12+
"trailingComma": "es5",
13+
"useTabs": false,
14+
"singleAttributePerLine": true
15+
}

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# React + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@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
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

eslint.config.js

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import react from 'eslint-plugin-react';
4+
import reactHooks from 'eslint-plugin-react-hooks';
5+
import reactRefresh from 'eslint-plugin-react-refresh';
6+
import prettier from 'eslint-config-prettier';
7+
import prettierPlugin from 'eslint-plugin-prettier';
8+
9+
import { includeIgnoreFile } from '@eslint/compat';
10+
import path from 'node:path';
11+
import { fileURLToPath } from 'node:url';
12+
13+
const __filename = fileURLToPath(import.meta.url);
14+
const __dirname = path.dirname(__filename);
15+
const gitignorePath = path.resolve(__dirname, '.gitignore');
16+
17+
export default [
18+
includeIgnoreFile(gitignorePath),
19+
{ ignores: ['dist'] },
20+
{
21+
files: ['**/*.{js,jsx}'],
22+
languageOptions: {
23+
ecmaVersion: 2020,
24+
globals: globals.browser,
25+
parserOptions: {
26+
ecmaVersion: 'latest',
27+
ecmaFeatures: { jsx: true },
28+
sourceType: 'module',
29+
},
30+
},
31+
settings: { react: { version: '18.3' } },
32+
plugins: {
33+
react,
34+
'react-hooks': reactHooks,
35+
'react-refresh': reactRefresh,
36+
prettier: prettierPlugin,
37+
},
38+
rules: {
39+
...js.configs.recommended.rules,
40+
...react.configs.recommended.rules,
41+
...react.configs['jsx-runtime'].rules,
42+
...reactHooks.configs.recommended.rules,
43+
'react/jsx-no-target-blank': 'off',
44+
'react/prop-types': 'off',
45+
'react-refresh/only-export-components': [
46+
'warn',
47+
{ allowConstantExport: true },
48+
],
49+
},
50+
},
51+
];

index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.jsx"></script>
12+
</body>
13+
</html>

jsconfig.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"compilerOptions": {
3+
"jsx": "react-jsx", // React JSX 구문을 사용하도록 설정 (React 17+에서는 자동으로 JSX를 지원)
4+
"checkJs": true, // JavaScript 파일에 대한 타입 검사 활성화 (VSCode에서 오류 경고 및 코드 완성 기능 향상)
5+
"baseUrl": ".", // 기본 경로를 현재 프로젝트의 루트로 설정 (상대 경로 대신 별칭 사용 가능)
6+
"paths": {
7+
"@/*": ["src/*"] // '@' 별칭을 'src' 폴더로 설정 (모듈 경로 참조 시 간단하게 사용 가능)
8+
},
9+
"types": ["vite/client"] // Vite 프로젝트에서 자동 완성 및 타입 정보를 제공 (Vite 관련 타입을 포함)
10+
},
11+
"include": [
12+
"src/**/*.d.ts", // 'src' 폴더 내에 있는 모든 타입 정의 파일 포함
13+
"src/**/*.js", // 'src' 폴더 내에 있는 모든 JavaScript 파일 포함
14+
"src/**/*.jsx", // 'src' 폴더 내에 있는 모든 JSX 파일 포함 (React 파일)
15+
"src/**/*.ts", // 'src' 폴더 내에 있는 모든 TypeScript 파일 포함
16+
"src/**/*.tsx" // 'src' 폴더 내에 있는 모든 TSX 파일 포함 (React와 TypeScript를 같이 사용할 때)
17+
],
18+
"exclude": [
19+
"node_modules", // 'node_modules' 폴더는 검사하지 않음
20+
"**/node_modules", // 서브 디렉토리의 'node_modules'도 검사하지 않음
21+
"dist" // 빌드 결과물이 저장되는 'dist' 폴더는 검사에서 제외
22+
]
23+
}

0 commit comments

Comments
 (0)