mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
fix(frontend): eslint config for tests and minor hook fixes
- Add eslint rules for test files with proper tsconfig and globals - Add no-empty rule exception for PromptInput - Remove unused renderTrigger dependency from useMemo in virtualized-text-view - Fix session status to properly set idle state when assistant message completes
This commit is contained in:
1 parent
e91c54ba20
commit
7f30a28be9
3 files changed
+20
-7
No files matched your search
@@ -35,16 +35,31 @@ export default defineConfig([
|
||||
'react-refresh/only-export-components': 'off',
|
||||
},
|
||||
},
|
||||
// Special rules for PromptInput
|
||||
{
|
||||
files: ['src/components/message/PromptInput.tsx'],
|
||||
rules: {
|
||||
'no-empty': 'off',
|
||||
}
|
||||
},
|
||||
// Special rules for test files
|
||||
{
|
||||
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx'],
|
||||
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx', 'vitest.config.ts'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
projectService: false
|
||||
},
|
||||
globals: globals.node,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off', // Often needed for mocks
|
||||
'@typescript-eslint/no-empty-function': 'off', // Common in test setup
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/no-unused-vars': ['warn', {
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_'
|
||||
}],
|
||||
'no-empty': 'off',
|
||||
}
|
||||
},
|
||||
])
|
||||
@@ -322,7 +322,7 @@ export const VirtualizedTextView = forwardRef<VirtualizedTextViewHandle, Virtual
|
||||
const range = calculateVisibleRange(scrollTopRef.current)
|
||||
currentVisibleRangeRef.current = range
|
||||
return range
|
||||
}, [calculateVisibleRange, renderTrigger])
|
||||
}, [calculateVisibleRange])
|
||||
|
||||
useEffect(() => {
|
||||
const { start, end } = visibleRange
|
||||
|
||||
@@ -123,9 +123,7 @@ export const useSSE = (opcodeUrl: string | null | undefined, directory?: string,
|
||||
|
||||
if (info.role === 'assistant') {
|
||||
const isComplete = 'completed' in info.time && info.time.completed
|
||||
if (!isComplete) {
|
||||
setSessionStatus(sessionID, { type: 'busy' })
|
||||
}
|
||||
setSessionStatus(sessionID, isComplete ? { type: 'idle' } : { type: 'busy' })
|
||||
}
|
||||
|
||||
const currentData = queryClient.getQueryData<MessageListResponse>(['opencode', 'messages', opcodeUrl, sessionID, directory])
|
||||
|
||||
Reference in new issue
Block a user