Skip to content

Commit 1b3b9ec

Browse files
committed
chore: react setting
웹 리액트 초기세팅(vite+react+prettier+eslint)
1 parent ec93f90 commit 1b3b9ec

15 files changed

+3271
-0
lines changed

.eslintrc.cjs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// eslint-disable-next-line no-undef
2+
module.exports = {
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
},
7+
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:prettier/recommended'],
8+
overrides: [],
9+
parserOptions: {
10+
ecmaVersion: 'latest',
11+
sourceType: 'module',
12+
},
13+
plugins: ['react', 'react-hooks', 'prettier'],
14+
rules: {
15+
quotes: ['error', 'single'],
16+
'no-duplicate-imports': 'error',
17+
'no-console': ['warn', { allow: ['warn', 'error', 'info'] }],
18+
'no-unused-vars': 'error',
19+
'no-multiple-empty-lines': 'error',
20+
'react/react-in-jsx-scope': 'off',
21+
'prettier/prettier': [
22+
'error',
23+
{
24+
endOfLine: 'auto',
25+
},
26+
],
27+
},
28+
};

.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

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"semi": true,
7+
"useTabs": false,
8+
"arrowParens": "always"
9+
}

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>

package.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "web",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vite build",
9+
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
10+
"format": "prettier --write --cache .",
11+
"preview": "vite preview"
12+
},
13+
"dependencies": {
14+
"react": "^18.2.0",
15+
"react-dom": "^18.2.0",
16+
"react-router-dom": "^6.14.1",
17+
"styled-components": "^6.0.2"
18+
},
19+
"devDependencies": {
20+
"@types/react": "^18.0.37",
21+
"@types/react-dom": "^18.0.11",
22+
"@vitejs/plugin-react": "^4.0.0",
23+
"eslint": "^8.44.0",
24+
"eslint-config-prettier": "^8.8.0",
25+
"eslint-plugin-prettier": "^4.2.1",
26+
"eslint-plugin-react": "^7.32.2",
27+
"eslint-plugin-react-hooks": "^4.6.0",
28+
"eslint-plugin-react-refresh": "^0.3.4",
29+
"prettier": "^2.8.8",
30+
"vite": "^4.3.9"
31+
}
32+
}

src/App.css

Whitespace-only changes.

src/App.jsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import './App.css';
2+
3+
function App() {
4+
return <div>Hello~!</div>;
5+
}
6+
7+
export default App;

src/assets/vite.png

160 KB
Loading

src/components/Button.jsx

Whitespace-only changes.

src/index.css

Whitespace-only changes.

src/main.jsx

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom/client';
3+
import App from './App.jsx';
4+
import './index.css';
5+
6+
ReactDOM.createRoot(document.getElementById('root')).render(
7+
<React.StrictMode>
8+
<App />
9+
</React.StrictMode>,
10+
);

src/pages/Main.jsx

Whitespace-only changes.

src/styles/main.css

Whitespace-only changes.

vite.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from 'vite';
2+
import react from '@vitejs/plugin-react';
3+
4+
// https://vitejs.dev/config/
5+
export default defineConfig({
6+
plugins: [react()],
7+
server: {
8+
port: 3000,
9+
},
10+
});

0 commit comments

Comments
 (0)