Skip to content

Commit df1233d

Browse files
committed
init
0 parents  commit df1233d

10 files changed

+5542
-0
lines changed

.env.sample

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PORT=3000

.gitignore

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Node.js 기본
2+
node_modules/
3+
pnpm-debug.log*
4+
5+
# 환경 변수 및 인증 정보
6+
.env
7+
.env.local
8+
.env.*.local
9+
10+
# TypeScript
11+
dist/
12+
*.tsbuildinfo
13+
14+
# IDE 및 에디터 관련 파일
15+
.idea/
16+
.vscode/
17+
*.swp
18+
*.swo
19+
20+
# OS별 시스템 파일
21+
.DS_Store
22+
Thumbs.db
23+
24+
# 로그 파일
25+
logs/
26+
*.log
27+
*.gz
28+
*.out
29+
30+
# 빌드 및 캐시 파일
31+
.cache/
32+
build/
33+
temp/
34+
tmp/
35+
36+
# 테스트 출력
37+
coverage/
38+
*.lcov

.prettierignore

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 의존성 관련
2+
node_modules
3+
pnpm-lock.yaml
4+
5+
# 빌드 결과물
6+
dist
7+
build
8+
9+
# 환경설정
10+
.env*
11+
12+
# IDE 설정
13+
.vscode
14+
.idea
15+
16+
# 로그파일
17+
logs
18+
*.log
19+
20+
# OS 파일
21+
.DS_Store
22+
Thumbs.db
23+
24+
# TypeScript
25+
*.tsbuildinfo
26+
.pnpm
27+
.eslintcache

.prettierrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"semi": true,
5+
"tabWidth": 2,
6+
"arrowParens": "always"
7+
}

eslint.config.js

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import eslint from '@eslint/js';
2+
import * as typescriptEslint from 'typescript-eslint';
3+
import eslintPluginPrettier from 'eslint-plugin-prettier';
4+
import { FlatCompat } from '@eslint/eslintrc';
5+
import path from 'path';
6+
import { fileURLToPath } from 'url';
7+
8+
// 기존 ESLint 설정을 새로운 flat config 형식으로 변환하기 위한 도구 초기화 (.eslintrc => eslint.config.js)
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
});
15+
16+
export default typescriptEslint.config(
17+
{
18+
files: ['**/*.{ts,tsx}'],
19+
},
20+
// 린트에서 무시할 파일/디렉토리 설정
21+
{
22+
ignores: ['**/node_modules/**', 'dist/**', 'build/**', 'coverage/**'],
23+
},
24+
// 기본 설정 확장
25+
eslint.configs.recommended,
26+
...typescriptEslint.configs.recommended,
27+
...typescriptEslint.configs.stylistic,
28+
...compat.extends('eslint-config-airbnb-base'),
29+
{
30+
// 파서 설정
31+
files: ['**/*.{ts,tsx}'],
32+
languageOptions: {
33+
parserOptions: {
34+
project: './tsconfig.json',
35+
warnOnUnsupportedTypeScriptVersion: false,
36+
},
37+
},
38+
// Prettier 플러그인 설정
39+
plugins: {
40+
prettier: eslintPluginPrettier, // ESLint와 Prettier 규칙 충돌 방지
41+
},
42+
},
43+
{
44+
rules: {
45+
'no-console': 'off',
46+
'import/extensions': 'off', // 파일 확장자 규칙 비활성화
47+
'import/no-unresolved': 'off', // 모듈 경로 해석 규칙 비활성화
48+
'import/extensions': [
49+
'off',
50+
'ignorePackages',
51+
{
52+
js: 'never',
53+
jsx: 'never',
54+
ts: 'never',
55+
tsx: 'never',
56+
},
57+
],
58+
// TypeScript 관련 규칙
59+
'@typescript-eslint/no-explicit-any': 'error', // any타입 사용 금지
60+
'@typescript-eslint/no-unused-vars': [
61+
// 미사용 변수 에러 = 언더스코어(명시적으로 사용) 예외
62+
'error',
63+
{
64+
argsIgnorePattern: '^_',
65+
varsIgnorePattern: '^_',
66+
caughtErrorsIgnorePattern: '^_',
67+
},
68+
],
69+
'@typescript-eslint/promise-function-async': 'error', // Promise 반환 함수에 async 강제
70+
'@typescript-eslint/explicit-function-return-type': 'off', // 함수 반환 타입 명시
71+
'@typescript-eslint/consistent-type-assertions': [
72+
// 타입 단언보다 타입 선언 사용 권장
73+
'error',
74+
{
75+
assertionStyle: 'as',
76+
objectLiteralTypeAssertions: 'allow-as-parameter',
77+
},
78+
],
79+
// 네이밍 컨벤션
80+
'@typescript-eslint/naming-convention': [
81+
'error',
82+
{
83+
selector: 'typeLike',
84+
format: ['PascalCase'],
85+
},
86+
{
87+
selector: 'variable',
88+
format: ['camelCase'],
89+
leadingUnderscore: 'allow',
90+
},
91+
{
92+
selector: 'function',
93+
format: ['camelCase'],
94+
},
95+
],
96+
},
97+
},
98+
);

package.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "velog-dashboard",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"type": "module",
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1",
9+
"dev": "ts-node-dev --respawn src/index.ts",
10+
"build": "node dist/index.js",
11+
"lint": "eslint src/**/*.ts",
12+
"lint:fix": "eslint . --ext .ts --fix",
13+
"format": "prettier --write src/**/*.ts"
14+
},
15+
"keywords": [],
16+
"author": "",
17+
"license": "ISC",
18+
"dependencies": {
19+
"dotenv": "^16.4.5",
20+
"express": "^4.21.1",
21+
"pg": "^8.13.1"
22+
},
23+
"devDependencies": {
24+
"@eslint/eslintrc": "^3.2.0",
25+
"@eslint/js": "^9.15.0",
26+
"@types/express": "^5.0.0",
27+
"@types/jest": "^29.5.14",
28+
"@types/node": "^22.9.0",
29+
"@types/pg": "^8.11.10",
30+
"eslint": "^9.15.0",
31+
"eslint-config-airbnb-base": "^15.0.0",
32+
"eslint-config-prettier": "^9.1.0",
33+
"eslint-plugin-prettier": "^5.2.1",
34+
"jest": "^29.7.0",
35+
"prettier": "^3.3.3",
36+
"ts-jest": "^29.2.5",
37+
"ts-node-dev": "^2.0.0",
38+
"typescript": "^5.6.3",
39+
"typescript-eslint": "^8.15.0"
40+
}
41+
}

0 commit comments

Comments
 (0)