import js from '@eslint/js'; import tseslint from '@typescript-eslint/eslint-plugin'; import tsparser from '@typescript-eslint/parser'; import prettier from 'eslint-config-prettier'; export default [ { ignores: ['node_modules/', 'dist/', 'coverage/', '**/dist/', '**/.astro/'], }, js.configs.recommended, { files: ['**/*.ts'], languageOptions: { parser: tsparser, parserOptions: { sourceType: 'module', ecmaVersion: 2022 }, }, plugins: { '@typescript-eslint': tseslint }, rules: { ...tseslint.configs.recommended.rules, // typescript-eslint: no-undef для TS отключаем — типы проверяет tsc, // иначе ложные срабатывания на DOM-глобалах (lib "DOM" видит только tsc) 'no-undef': 'off', // strict-профиль: any запрещён спекой проекта '@typescript-eslint/no-explicit-any': 'error', '@typescript-eslint/explicit-function-return-type': 'warn', '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], 'no-console': ['warn', { allow: ['warn', 'error'] }], }, }, prettier, ];