const OFF = 0; const WARN = 1; const ERROR = 2; module.exports = { env: { browser: true, es2020: true, node: true, }, extends: [ 'plugin:react/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'prettier', ], parser: '@typescript-eslint/parser', parserOptions: { ecmaFeatures: { jsx: true, }, ecmaVersion: 11, sourceType: 'module', }, plugins: ['prettier', 'react', 'react-hooks', 'unicorn', 'promise', '@typescript-eslint'], settings: { 'import/resolver': { node: { extensions: ['.tsx', '.ts', '.js', '.json'], }, typescript: { project: './tsconfig.json', }, }, react: { version: 'detect', }, }, root: true, rules: { '@typescript-eslint/explicit-function-return-type': [OFF], '@typescript-eslint/explicit-module-boundary-types': [OFF], 'prefer-const': [OFF], 'no-var': [OFF], 'comma-dangle': [OFF], 'arrow-parens': [OFF], 'no-multiple-empty-lines': [OFF], '@typescript-eslint/no-explicit-any': [OFF], '@typescript-eslint/no-var-requires': [OFF], '@typescript-eslint/no-unused-vars': [OFF], '@typescript-eslint/explicit-member-accessibility': [OFF], '@typescript-eslint/interface-name-prefix': [OFF], '@typescript-eslint/no-empty-interface': [OFF], 'react/prop-types': [OFF], 'react/display-name': [OFF], 'unicorn/filename-case': OFF, 'no-script-url': OFF, 'import/no-dynamic-require': OFF, 'no-await-in-loop': OFF, 'no-loop-func': OFF, 'unicorn/prefer-query-selector': ERROR, 'unicorn/no-null': OFF, 'unicorn/no-array-reduce': OFF, 'unicorn/consistent-function-scoping': OFF, 'unicorn/no-array-callback-reference': OFF, 'unicorn/prefer-string-slice': OFF, 'unicorn/consistent-destructuring': OFF, 'no-underscore-dangle': OFF, 'unicorn/prefer-array-some': OFF, 'unicorn/prefer-spread': OFF, 'jsx-a11y/anchor-is-valid': OFF, '@typescript-eslint/no-useless-constructor': ERROR, '@typescript-eslint/no-empty-function': WARN, '@typescript-eslint/no-var-requires': OFF, '@typescript-eslint/explicit-function-return-type': OFF, '@typescript-eslint/explicit-module-boundary-types': OFF, '@typescript-eslint/no-explicit-any': OFF, '@typescript-eslint/no-unused-vars': WARN, '@typescript-eslint/no-non-null-assertion': OFF, '@typescript-eslint/ban-types': OFF, '@typescript-eslint/no-non-null-asserted-optional-chain': OFF, '@typescript-eslint/no-empty-interface': OFF, '@typescript-eslint/ban-ts-comment': OFF, 'react/jsx-filename-extension': [ERROR, { extensions: ['.tsx', 'ts', '.jsx', 'js'] }], 'react/jsx-indent-props': [ERROR, 2], 'react/jsx-indent': [ERROR, 2], 'react/jsx-one-expression-per-line': OFF, 'react/destructuring-assignment': OFF, 'react/state-in-constructor': OFF, 'react/jsx-props-no-spreading': OFF, 'react/prop-types': OFF, 'react/display-name': OFF, 'react/require-default-props': OFF, 'react/no-array-index-key': OFF, 'react/no-unused-prop-types': WARN, 'react-hooks/exhaustive-deps': OFF, 'jsx-a11y/click-events-have-key-events': OFF, 'jsx-a11y/no-noninteractive-element-interactions': OFF, 'jsx-a11y/no-static-element-interactions': OFF, 'lines-between-class-members': [ERROR, 'always'], // indent: [ERROR, 2, { SwitchCase: 1 }], 'linebreak-style': OFF, quotes: [ERROR, 'single'], 'no-unused-expressions': OFF, 'no-plusplus': OFF, 'no-console': WARN, 'no-continue': OFF, 'consistent-return': OFF, 'no-param-reassign': OFF, 'no-debugger': OFF, 'class-methods-use-this': OFF, 'global-require': OFF, 'no-use-before-define': OFF, 'no-restricted-syntax': OFF, 'promise/always-return': OFF, 'promise/catch-or-return': OFF, 'promise/no-nesting': OFF, 'no-async-promise-executor': OFF, 'prefer-promise-reject-errors': OFF, 'prefer-const': OFF, 'react/no-children-prop': OFF, 'max-classes-per-file': OFF, 'unicorn/no-abusive-eslint-disable': OFF, 'prettier/prettier': ['error', { endOfLine: 'auto' }], }, overrides: [ { files: ['*.ts', '*.tsx'], rules: { // use @typescript-eslint/no-shadow 'no-shadow': [OFF], 'no-console': WARN, }, }, ], };