Files
opencode-manager/frontend/eslint.config.js
T
Chris Scott 7f30a28be9 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
2026-01-19 22:07:12 -05:00

66 lines
1.7 KiB
JavaScript

import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
projectService: {
defaultProject: "./tsconfig.app.json"
},
},
},
rules: {
'no-console': ['warn', { allow: ['warn', 'error'] }],
'react-hooks/exhaustive-deps': 'warn',
},
},
{
files: ['src/components/ui/**/*.{ts,tsx}', 'src/components/message/FileToolRender.tsx'],
rules: {
'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', 'vitest.config.ts'],
languageOptions: {
parserOptions: {
tsconfigRootDir: import.meta.dirname,
projectService: false
},
globals: globals.node,
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}],
'no-empty': 'off',
}
},
])