mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
66 lines
1.8 KiB
JavaScript
66 lines
1.8 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', 'src/sw.ts']),
|
|
{
|
|
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', 'src/components/message/CodePreview.tsx', 'src/components/message/ToolDetails.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': ['error', {
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_'
|
|
}],
|
|
'no-empty': 'off',
|
|
}
|
|
},
|
|
])
|