import eslint from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import prettier from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';
export default [
eslint.configs.recommended,
{
files: ['**/*.ts'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.json',
},
globals: {
console: 'readonly',
process: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
prettier: prettier,
},
rules: {
...tseslint.configs.recommended.rules,
...tseslint.configs['recommended-requiring-type-checking'].rules,
...prettierConfig.rules,
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/strict-boolean-expressions': 'warn',
'@typescript-eslint/require-await': 'off',
'prettier/prettier': 'error',
'no-console': 'off',
'no-undef': 'off',
},
},
{
ignores: [
'dist/**',
'node_modules/**',
'*.config.js',
'**/*.test.ts',
'**/*.spec.ts',
],
},
];