From 8e67d25b3b6c87d232ba09c3c3ad2771cd0e09d1 Mon Sep 17 00:00:00 2001 From: jung-geun Date: Sat, 9 May 2026 15:39:01 +0900 Subject: [PATCH] =?UTF-8?q?v2=20=EC=8A=A4=EC=BA=90=ED=8F=B4=EB=93=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(tsconfig=204=EC=A2=85,=20eslint,=20pretti?= =?UTF-8?q?er,=20vitest)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TypeScript strict + electron-vite + Vitest 환경을 위한 설정 파일 추가. tsconfig 4종: 베이스/cli/node(main+preload)/web(renderer) 역할 분담. Co-Authored-By: Claude Opus 4.7 --- .eslintrc.cjs | 17 +++++++++++++++++ .prettierrc | 6 ++++++ tsconfig.cli.json | 12 ++++++++++++ tsconfig.json | 15 +++++++++++++++ tsconfig.node.json | 11 +++++++++++ tsconfig.web.json | 12 ++++++++++++ vitest.config.ts | 9 +++++++++ 7 files changed, 82 insertions(+) create mode 100644 .eslintrc.cjs create mode 100644 .prettierrc create mode 100644 tsconfig.cli.json create mode 100644 tsconfig.json create mode 100644 tsconfig.node.json create mode 100644 tsconfig.web.json create mode 100644 vitest.config.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..8a0ab60 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,17 @@ +module.exports = { + root: true, + env: { node: true, es2022: true }, + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], + rules: { + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], + '@typescript-eslint/no-explicit-any': 'warn', + }, + overrides: [ + { + files: ['src/renderer/**/*.tsx', 'src/renderer/**/*.ts'], + env: { browser: true }, + }, + ], +}; diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..07fedc5 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": true, + "singleQuote": true, + "printWidth": 100, + "trailingComma": "es5" +} diff --git a/tsconfig.cli.json b/tsconfig.cli.json new file mode 100644 index 0000000..91664d2 --- /dev/null +++ b/tsconfig.cli.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "CommonJS", + "moduleResolution": "node", + "outDir": "out/cli", + "rootDir": "src", + "declaration": false, + "types": ["node"] + }, + "include": ["src/core/**/*", "src/cli/**/*"] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..abbd8b5 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2022", + "lib": ["ES2022"], + "module": "CommonJS", + "moduleResolution": "bundler", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "forceConsistentCasingInFileNames": true, + "baseUrl": "." + }, + "exclude": ["node_modules", "out", "dist"] +} diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..ac10d8e --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "composite": true, + "lib": ["ES2022"], + "module": "CommonJS", + "moduleResolution": "bundler", + "types": ["node"] + }, + "include": ["src/main/**/*", "src/preload/**/*", "src/core/**/*", "electron.vite.config.ts"] +} diff --git a/tsconfig.web.json b/tsconfig.web.json new file mode 100644 index 0000000..7119430 --- /dev/null +++ b/tsconfig.web.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "composite": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "module": "ESNext", + "moduleResolution": "bundler", + "jsx": "react-jsx", + "types": ["node"] + }, + "include": ["src/renderer/**/*"] +} diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..6860f59 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + environment: 'node', + include: ['src/**/__tests__/**/*.test.ts'], + globals: true, + }, +});