module.exports = {
  env: {
    browser: true,
    commonjs: true,
    es6: true,
    jest: true,
    node: true,
  },
  parser: '@babel/eslint-parser',
  extends: [
    'eslint:recommended',
    'plugin:react/recommended',
    'plugin:react-hooks/recommended',
    'plugin:jsx-a11y/recommended',
    'plugin:jest/recommended',
    'plugin:testing-library/react',
  ],
  parserOptions: {
    babelOptions: {
      presets: [ '@babel/preset-react' ],
    },
    ecmaFeatures: {
      jsx: true,
    },
    ecmaVersion: 2022,
    requireConfigFile: false,
    sourceType: 'module',
  },
  plugins: [
    'import',
    'etc',
    '@typescript-eslint',
    'eslint-plugin-no-inline-styles',
    'destructuring',
  ],
  root: true,
  rules: {
    quotes: [ 'error', 'single', { avoidEscape: true, allowTemplateLiterals: true } ],
    semi: [ 'error', 'always' ],
    'testing-library/render-result-naming-convention': 'off',
    'react/display-name': 'off',
    'react/prop-types': 'off',
    'react/react-in-jsx-scope': 'off',
    'no-var': 'error',
    'no-trailing-spaces': 'error',
    'space-infix-ops': 'error',
    'arrow-spacing': 'error',
    'prefer-const': 'error',
    'space-in-parens': [ 'error', 'never' ],
    'arrow-parens': [ 'error', 'as-needed' ],
    'comma-dangle': [ 'error', 'always-multiline' ],
    'max-len': [ 'error', { code: 120 } ],
    'no-console': [ 'error', { allow: [ 'log', 'warn', 'error' ] } ],
    'no-unused-vars': 'error',
    'no-undef': 'error',
    'no-duplicate-imports': 'error',
    'object-curly-spacing': [ 'error', 'always' ],
    'array-bracket-spacing': [ 'error', 'always' ],
    'etc/no-commented-out-code': 'error',
    'destructuring/in-params': 'error',
    'jsx-a11y/click-events-have-key-events': 'off',
  },
  settings: {
    react: {
      version: 'detect',
    },
  },
};