text: module.exports = {
    env: {
      browser: true,
      es6: true,
      node: true,
    },
    extends: [
      'airbnb-base',
      'eslint:recommended',
      'plugin:@typescript-eslint/eslint-recommended',
      'plugin:@typescript-eslint/recommended',
      'plugin:import/errors',
      'plugin:import/warnings',
      'plugin:import/typescript',
      'plugin:react/recommended',
      'plugin:react-hooks/recommended',
      'prettier',
    ],
    globals: {
      Atomics: 'readonly',
      cy: 'readonly',
      Cypress: 'readonly',
      SharedArrayBuffer: 'readonly',
      __DEV__: true,
    },
    parser: '@typescript-eslint/parser',
    parserOptions: {
      ecmaVersion: 2018,
      project: './tsconfig.json',
      sourceType: 'module',
    },
    plugins: ['@typescript-eslint', 'import', 'prefer-arrow', 'prettier'],
    root: true,
    // TODO Fix Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser issue without ignorePatterns
    ignorePatterns: [
      '**/cypress/integration/*.ts',
      '**/cypress/plugins/*.js',
      '**/cypress/support/*.js',
    ],
    rules: {
      // eslint official
      camelcase: 'off',
      'class-methods-use-this': 'off',
      'linebreak-style': ['error', 'unix'],
      'newline-before-return': 'error',
      'no-console': 'warn',
      'no-continue': 'off',
      'no-use-before-define': 'off',
      quotes: ['error', 'single', { avoidEscape: true }],
      'require-yield': 'error',
      semi: ['error', 'never', { beforeStatementContinuationChars: 'never' }],
      'import/no-unresolved': 'off',
      'no-nested-ternary': 'off',
      'no-underscore-dangle': 'off',
  
      // @typescript-eslint
      '@typescript-eslint/explicit-function-return-type': 'off',
      '@typescript-eslint/explicit-module-boundary-types': 'off',
      '@typescript-eslint/explicit-member-accessibility': 'off',
      '@typescript-eslint/no-explicit-any': 'off',
      indent: 'off',
      '@typescript-eslint/indent': 'off',
      '@typescript-eslint/no-unnecessary-type-assertion': 'error',
      '@typescript-eslint/no-unused-vars': 'error',
      '@typescript-eslint/no-empty-function': 'off',
      '@typescript-eslint/prefer-interface': 'off',
      '@typescript-eslint/ban-ts-comment': 'off',
      '@typescript-eslint/no-non-null-assertion': 'off',
  
      // react
      'react/prop-types': 'off',
      'react/display-name': 'off',
  
      // airbnb
      'no-restricted-syntax': [
        'error',
        {
          selector: 'ForInStatement',
          message:
            'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
        },
        {
          selector: 'LabeledStatement',
          message:
            'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
        },
        {
          selector: 'WithStatement',
          message:
            '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
        },
      ],
      // prefer-arrow
      'prefer-arrow/prefer-arrow-functions': [
        'error',
        {
          disallowPrototype: true,
          singleReturnOnly: true,
          classPropertiesAllowed: false,
        },
      ],
  
      // import
      'import/extensions': [
        'error',
        'ignorePackages',
        {
          js: 'never',
          ts: 'never',
          tsx: 'never',
        },
      ],
      'import/no-extraneous-dependencies': [
        'error',
        {
          devDependencies: [
            '**/__tests__/**',
            '**/*/*.test.*',
            'src/setupTests.*',
          ],
        },
      ],
      'import/prefer-default-export': 'off',
    },
    settings: {
      'import/parsers': {
        '@typescript-eslint/parser': ['.ts', '.tsx'],
      },
      'import/resolver': {
        node: {
          extensions: ['.js', '.ts', '.tsx'],
          paths: ['./'],
        },
      },
      react: {
        createClass: 'createReactClass', // Regex for Component Factory to use,
        // default to "createReactClass"
        pragma: 'React', // Pragma to use, default to "React"
        fragment: 'Fragment', // Fragment to use (may be a property of <pragma>), default to "Fragment"
        version: 'detect', // React version. "detect" automatically picks the version you have installed.
        // You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
        // default to latest and warns if missing
        // It will default to "detect" in the future
      },
      'react-hooks/exhaustive-deps': [
        'warn',
        {
          additionalHooks: 'useRecoilCallback|useRecoilTransaction_UNSTABLE',
        },
      ],
      propWrapperFunctions: [
        // The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
        'forbidExtraProps',
        { property: 'freeze', object: 'Object' },
        { property: 'myFavoriteWrapper' },
      ],
      linkComponents: [
        // Components used as alternatives to <a> for linking, eg. <Link to={ url } />
        'Hyperlink',
        { name: 'Link', linkAttribute: 'to' },
      ],
    },
  }
  