import eslint from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
export default [
eslint.configs.recommended,
{
files: ['src/**/*.ts'],
languageOptions: {
parser: tsparser,
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2022,
sourceType: 'module',
},
globals: {
console: 'readonly',
process: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
Buffer: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
},
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/strict-boolean-expressions': 'error',
'no-console': 'error',
'max-lines': ['error', { max: 300, skipBlankLines: true, skipComments: true }],
'max-lines-per-function': ['error', { max: 50, skipBlankLines: true, skipComments: true }],
'max-depth': ['error', 3],
'no-undef': 'off',
},
},
{
ignores: ['dist/**', 'node_modules/**', '**/*.test.ts', 'jest.config.js', 'eslint.config.js'],
},
];