import js from '@eslint/js'
import typescript from '@typescript-eslint/eslint-plugin'
import typescriptParser from '@typescript-eslint/parser'
export default [
js.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.json',
},
},
plugins: {
'@typescript-eslint': typescript,
},
rules: {
...typescript.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-require-imports': 'off',
'prefer-const': 'error',
'no-var': 'error',
'no-console': 'off',
'no-undef': 'off',
'no-useless-escape': 'warn',
},
},
{
files: ['**/__tests__/**/*.ts', '**/*.test.ts', '**/*.test.tsx'],
rules: {
'@typescript-eslint/no-unused-vars': 'warn',
'no-control-regex': 'off',
},
},
{
ignores: [
'dist/**',
'build/**',
'coverage/**',
'node_modules/**',
'**/*.d.ts',
'**/*.min.js',
'**/*.bundle.js',
'**/*.tsbuildinfo',
'specs/**',
'.specify/**',
'.serena/**',
'.claude/**',
],
},
]