tests pass

This commit is contained in:
Pedram Amini
2025-12-22 19:31:27 -06:00
parent a8edadbdcf
commit 5d91f34b2f
6 changed files with 13 additions and 3 deletions

3
.gitignore vendored
View File

@@ -36,6 +36,9 @@ Thumbs.db
*.swp *.swp
*.swo *.swo
# ESLint
.eslintcache
# Electron # Electron
out/ out/

View File

@@ -163,6 +163,7 @@ Run TypeScript type checking and ESLint to catch errors before building:
```bash ```bash
npm run lint # TypeScript type checking (all configs: renderer, main, cli) npm run lint # TypeScript type checking (all configs: renderer, main, cli)
npm run lint:eslint # ESLint code quality checks (React hooks, unused vars, etc.) npm run lint:eslint # ESLint code quality checks (React hooks, unused vars, etc.)
npm run lint:eslint -- --fix # Auto-fix ESLint issues where possible
``` ```
### TypeScript Linting ### TypeScript Linting
@@ -176,7 +177,7 @@ The TypeScript linter checks all three build configurations:
ESLint is configured with TypeScript and React plugins (`eslint.config.mjs`): ESLint is configured with TypeScript and React plugins (`eslint.config.mjs`):
- `react-hooks/rules-of-hooks` - Enforces React hooks rules - `react-hooks/rules-of-hooks` - Enforces React hooks rules
- `react-hooks/exhaustive-deps` - Warns about missing hook dependencies - `react-hooks/exhaustive-deps` - Enforces correct hook dependencies
- `@typescript-eslint/no-unused-vars` - Warns about unused variables - `@typescript-eslint/no-unused-vars` - Warns about unused variables
- `prefer-const` - Suggests const for never-reassigned variables - `prefer-const` - Suggests const for never-reassigned variables

View File

@@ -55,7 +55,8 @@ export default tseslint.config(
argsIgnorePattern: '^_', argsIgnorePattern: '^_',
varsIgnorePattern: '^_', varsIgnorePattern: '^_',
}], }],
'@typescript-eslint/no-explicit-any': 'off', // Too many existing uses // TODO: Change to 'warn' after reducing ~304 existing uses
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'off', '@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-require-imports': 'off', // Used in main process '@typescript-eslint/no-require-imports': 'off', // Used in main process
@@ -67,6 +68,7 @@ export default tseslint.config(
// React Hooks rules // React Hooks rules
'react-hooks/rules-of-hooks': 'error', 'react-hooks/rules-of-hooks': 'error',
// TODO: Change to 'error' after fixing ~74 existing violations
'react-hooks/exhaustive-deps': 'warn', 'react-hooks/exhaustive-deps': 'warn',
// General rules // General rules

View File

@@ -24,6 +24,7 @@ import * as os from 'os';
describe('agent-detector', () => { describe('agent-detector', () => {
let detector: AgentDetector; let detector: AgentDetector;
const mockExecFileNoThrow = vi.mocked(execFileNoThrow); const mockExecFileNoThrow = vi.mocked(execFileNoThrow);
const originalPlatform = process.platform;
beforeEach(() => { beforeEach(() => {
vi.clearAllMocks(); vi.clearAllMocks();
@@ -34,6 +35,9 @@ describe('agent-detector', () => {
afterEach(() => { afterEach(() => {
vi.restoreAllMocks(); vi.restoreAllMocks();
// Ensure process.platform is always restored to the original value
// This is critical because some tests modify it to test Windows/Unix behavior
Object.defineProperty(process, 'platform', { value: originalPlatform, configurable: true });
}); });
describe('Type exports', () => { describe('Type exports', () => {

View File

@@ -211,7 +211,6 @@ describe('Debug Package Packager', () => {
'storage-info.json': { paths: {} }, 'storage-info.json': { paths: {} },
'group-chats.json': [], 'group-chats.json': [],
'batch-state.json': { activeSessions: [] }, 'batch-state.json': { activeSessions: [] },
'windows-diagnostics.json': { platform: 'win32' },
'collection-errors.json': [], 'collection-errors.json': [],
}; };

View File

@@ -16,6 +16,7 @@
"declaration": false, "declaration": false,
"sourceMap": true "sourceMap": true
}, },
// CLI uses shared types, prompts for auto-run synopsis, and types for module declarations
"include": ["src/cli/**/*", "src/shared/**/*", "src/prompts/**/*", "src/types/**/*"], "include": ["src/cli/**/*", "src/shared/**/*", "src/prompts/**/*", "src/types/**/*"],
"exclude": ["node_modules", "dist", "release"] "exclude": ["node_modules", "dist", "release"]
} }