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
*.swo
# ESLint
.eslintcache
# Electron
out/

View File

@@ -163,6 +163,7 @@ Run TypeScript type checking and ESLint to catch errors before building:
```bash
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 -- --fix # Auto-fix ESLint issues where possible
```
### 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`):
- `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
- `prefer-const` - Suggests const for never-reassigned variables

View File

@@ -55,7 +55,8 @@ export default tseslint.config(
argsIgnorePattern: '^_',
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-require-imports': 'off', // Used in main process
@@ -67,6 +68,7 @@ export default tseslint.config(
// React Hooks rules
'react-hooks/rules-of-hooks': 'error',
// TODO: Change to 'error' after fixing ~74 existing violations
'react-hooks/exhaustive-deps': 'warn',
// General rules

View File

@@ -24,6 +24,7 @@ import * as os from 'os';
describe('agent-detector', () => {
let detector: AgentDetector;
const mockExecFileNoThrow = vi.mocked(execFileNoThrow);
const originalPlatform = process.platform;
beforeEach(() => {
vi.clearAllMocks();
@@ -34,6 +35,9 @@ describe('agent-detector', () => {
afterEach(() => {
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', () => {

View File

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

View File

@@ -16,6 +16,7 @@
"declaration": false,
"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/**/*"],
"exclude": ["node_modules", "dist", "release"]
}