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, + }, +});