import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
export default [
js.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
globals: {
// Node.js globals
process: 'readonly',
Buffer: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
fetch: 'readonly',
TextEncoder: 'readonly',
TextDecoder: 'readonly',
require: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
},
rules: {
...tseslint.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-empty-object-type': 'warn',
'no-console': 'off',
'no-undef': 'off', // TypeScript handles this
'no-useless-escape': 'warn',
'no-case-declarations': 'warn',
'no-unreachable': 'warn',
},
},
{
ignores: ['build/**', 'node_modules/**', 'user-files/**'],
},
];