mirror of
https://github.com/jlengrand/Maestro.git
synced 2026-03-10 00:21:21 +00:00
tests pass
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -36,6 +36,9 @@ Thumbs.db
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# ESLint
|
||||
.eslintcache
|
||||
|
||||
# Electron
|
||||
out/
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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': [],
|
||||
};
|
||||
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user