/** @type {import('eslint').Linter.FlatConfig[]} */
const base = require('./eslint.config.cjs');

const typeAwareLayer = {
    files: ['**/*.{ts,tsx}'],
    languageOptions: {
        parser: require('@typescript-eslint/parser'),
        parserOptions: {
            project: ['./tsconfig.eslint.json'],
            tsconfigRootDir: __dirname,
        },
    },
    plugins: {
        '@typescript-eslint': require('@typescript-eslint/eslint-plugin'),
    },
    rules: {
        '@typescript-eslint/no-floating-promises': 'warn',
        '@typescript-eslint/no-misused-promises': ['warn', { checksVoidReturn: false }],
        '@typescript-eslint/no-unsafe-assignment': 'warn',
        '@typescript-eslint/no-unsafe-member-access': 'warn',
        '@typescript-eslint/no-unsafe-argument': 'warn',
    },
};

module.exports = [...base, typeAwareLayer];
