module.exports = {
  overrides: [
    {
      extends: [
        'plugin:@typescript-eslint/eslint-recommended',
        'plugin:@typescript-eslint/recommended',
        'plugin:@typescript-eslint/recommended-requiring-type-checking',
        'plugin:import/typescript',
      ],
      files: ['*.ts', '*.tsx'],
      parser: '@typescript-eslint/parser',
      parserOptions: {
        project: './tsconfig.json',
      },
      plugins: ['@typescript-eslint/eslint-plugin'],
      rules: {
        '@typescript-eslint/await-thenable': 2,
        '@typescript-eslint/ban-ts-comment': 0,
        '@typescript-eslint/ban-ts-ignore': 0,
        '@typescript-eslint/brace-style': [2, '1tbs'],
        '@typescript-eslint/explicit-function-return-type': 0,
        '@typescript-eslint/explicit-module-boundary-types': [
          2,
          {
            allowArgumentsExplicitlyTypedAsAny: true,
            allowHigherOrderFunctions: true,
            allowTypedFunctionExpressions: true,
          },
        ],
        '@typescript-eslint/naming-convention': [
          2,
          {
            filter: {
              match: false,
              regex: '^(__esModule)$',
            },
            format: ['camelCase'],
            selector: 'default',
          },
          {
            format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
            selector: 'variable',
          },
          {
            format: ['camelCase', 'PascalCase'],
            leadingUnderscore: 'allow',
            selector: 'parameter',
          },
          {
            format: ['camelCase', 'PascalCase'],
            selector: 'function',
          },
          {
            format: ['camelCase'],
            leadingUnderscore: 'require',
            modifiers: ['private'],
            selector: 'memberLike',
          },
          {
            format: ['PascalCase'],
            selector: 'typeLike',
          },
          {
            filter: '_plural$',
            format: null,
            selector: 'property',
          },
          {
            filter: {
              match: false,
              regex: '^(__esModule)$',
            },
            format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
            leadingUnderscore: 'allow',
            selector: 'property',
          },
        ],
        '@typescript-eslint/no-empty-interface': 0,
        '@typescript-eslint/no-explicit-any': 1,
        '@typescript-eslint/no-non-null-assertion': 0,
        '@typescript-eslint/no-shadow': 2,
        '@typescript-eslint/no-unnecessary-type-assertion': 0,
        '@typescript-eslint/no-unsafe-assignment': 0,
        '@typescript-eslint/no-unsafe-call': 0,
        '@typescript-eslint/no-unsafe-member-access': 0,
        '@typescript-eslint/no-unsafe-return': 0,
        '@typescript-eslint/no-unused-vars': 0,
        '@typescript-eslint/no-use-before-define': [
          2,
          {
            classes: true,
            functions: false,
            variables: false,
          },
        ],
        '@typescript-eslint/promise-function-async': 2,
        '@typescript-eslint/require-await': 2,
        '@typescript-eslint/restrict-template-expressions': [
          2,
          {
            allowNullish: true,
          },
        ],
        '@typescript-eslint/return-await': [2, 'always'],
        'brace-style': 0,
        camelcase: 0,
        'no-return-await': 0,
        'no-shadow': 0,
        'no-use-before-define': 0,
        'require-await': 0,
        'unused-imports/no-unused-imports-ts': 2,
        'unused-imports/no-unused-vars-ts': 0,
      },
    },
  ],
  settings: {
    'import/extensions': ['.ts', '.tsx'],
    'import/parsers': {
      '@typescript-eslint/parser': ['.ts', '.tsx'],
    },
    'import/resolver': {
      typescript: {
        alwaysTryTypes: true,
      },
    },
  },
};
