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