import { defineConfig } from '@dg-scripts/eslint-config'

export default defineConfig(
  {
    e18e: false,
    typescript: true,
  },
  {
    name: 'markdown/code',
    files: ['**/*.md/**/*.{js,jsx,ts,tsx}'],
    rules: {
      'no-extend-native': 'off',
      'no-new': 'off',
      'no-new-func': 'off',
      'no-new-wrappers': 'off',
      'no-proto': 'off',
      'no-prototype-builtins': 'off',
      'no-restricted-properties': 'off',
      'antfu/top-level-function': 'off',
      'no-self-compare': 'off',
      'prefer-promise-reject-errors': 'off',
      'react/exhaustive-deps': 'off',
      'react/no-access-state-in-setstate': 'off',
      'react/no-children-map': 'off',
      'react/no-children-to-array': 'off',
      'react/no-clone-element': 'off',
      'react/no-set-state-in-component-did-mount': 'off',
      'react/no-unnecessary-use-prefix': 'off',
      'react/no-unsafe-component-will-mount': 'off',
      'react/no-unsafe-component-will-receive-props': 'off',
      'react/no-unused-class-component-members': 'off',
      'react/purity': 'off',
      'react/refs': 'off',
      'react/set-state-in-effect': 'off',
      'react/set-state-in-render': 'off',
      'react/static-components': 'off',
      'react/use-state': 'off',
      'react-refresh/only-export-components': 'off',
      'ts/no-this-alias': 'off',
      'ts/no-unsafe-function-type': 'off',
      'unicorn/new-for-builtins': 'off',
      'unicorn/no-instanceof-builtins': 'off',
    },
  },
  {
    name: 'markdown/markdown',
    files: ['**/*.md/**/*.md'],
    rules: {
      'format/prettier': 'off',
    },
  },
  {
    name: 'ui',
    files: ['src/components/ui/**/*.tsx'],
    rules: {
      'react/no-array-index-key': 'off',
      'react/set-state-in-effect': 'off',
      'react/static-components': 'off',
      'react-refresh/only-export-components': 'off',
    },
  },
)
