module.exports = { env: { es6: true, jest: true, node: true, }, extends: [ 'eslint-config-react-app', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', ], globals: { browser: true, document: false, fetch: true, navigator: false, window: false, }, parser: '@typescript-eslint/parser', parserOptions: { ecmaFeatures: { jsx: true, }, ecmaVersion: 9, sourceType: 'module', }, plugins: [ '@typescript-eslint', 'import', 'jest', 'node', 'promise', 'prettier', 'react', 'react-hooks', ], rules: { '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-member-accessibility': 'off', '@typescript-eslint/no-var-requires': 'off', 'accessor-pairs': 'error', 'array-callback-return': 'error', 'arrow-body-style': 'error', camelcase: ['error', { properties: 'never' }], complexity: ['error', 10], 'constructor-super': 'error', 'dot-notation': 'error', eqeqeq: 'error', 'for-direction': 'error', 'import/export': 'error', // 'import/exports-last': 'error', 'import/first': 'error', 'import/no-cycle': 'error', 'import/no-duplicates': 'error', 'import/no-webpack-loader-syntax': 'error', 'jest/consistent-test-it': [ 'error', { fn: 'it', withinDescribe: 'it', }, ], 'jest/no-disabled-tests': 'warn', 'jest/no-focused-tests': 'error', 'jest/no-identical-title': 'error', 'jest/no-jest-import': 'error', 'jest/no-test-prefixes': 'error', 'jest/prefer-to-be-null': 'error', 'jest/prefer-to-be-undefined': 'error', 'jest/prefer-to-have-length': 'error', 'jest/valid-describe': 'error', 'jest/valid-expect': 'error', 'jest/valid-expect-in-promise': 'error', 'jsx-quotes': ['error', 'prefer-double'], 'linebreak-style': ['error', 'unix'], 'max-len': [ 'error', 120, { ignoreComments: true, ignoreRegExpLiterals: true, ignoreStrings: true, ignoreTemplateLiterals: true, ignoreUrls: true, }, ], 'new-cap': ['error', { capIsNew: false, newIsCap: true }], 'new-parens': 'error', 'no-array-constructor': 'error', 'no-await-in-loop': 'error', 'no-buffer-constructor': 'error', 'no-caller': 'error', 'no-case-declarations': 'error', 'no-class-assign': 'error', 'no-compare-neg-zero': 'error', 'no-cond-assign': 'error', 'no-confusing-arrow': ['error', { allowParens: false }], 'no-const-assign': 'error', 'no-constant-condition': 'error', 'no-control-regex': 'error', 'no-debugger': 'error', 'no-delete-var': 'error', 'no-dupe-args': 'error', 'no-dupe-class-members': 'error', 'no-dupe-keys': 'error', 'no-duplicate-case': 'error', 'no-duplicate-imports': 'error', 'no-else-return': 'error', 'no-empty': 'error', 'no-empty-character-class': 'error', 'no-empty-pattern': 'error', 'no-eq-null': 'error', 'no-eval': 'error', 'no-ex-assign': 'error', 'no-extend-native': 'error', 'no-extra-bind': 'error', 'no-extra-boolean-cast': 'error', 'no-fallthrough': 'error', 'no-func-assign': 'error', 'no-global-assign': 'error', 'no-implicit-coercion': [ 'error', { boolean: false, }, ], 'no-inner-declarations': 'error', 'no-invalid-regexp': 'error', 'no-irregular-whitespace': 'error', 'no-iterator': 'error', 'no-label-var': 'error', 'no-labels': 'error', 'no-lone-blocks': 'error', 'no-mixed-operators': [ 'error', { allowSamePrecedence: true, groups: [ ['==', '!=', '===', '!==', '>', '>=', '<', '<='], ['&&', '||'], ['in', 'instanceof'], ], }, ], 'no-negated-condition': 'warn', 'no-negated-in-lhs': 'error', 'no-nested-ternary': 'error', 'no-new': 'error', 'no-new-func': 'error', 'no-new-object': 'error', 'no-new-require': 'error', 'no-new-symbol': 'error', 'no-new-wrappers': 'error', 'no-obj-calls': 'error', 'no-octal': 'error', 'no-octal-escape': 'error', 'no-path-concat': 'error', 'no-proto': 'error', 'no-redeclare': 'error', 'no-regex-spaces': 'error', 'no-return-assign': ['error', 'except-parens'], 'no-return-await': 'error', 'no-self-assign': 'error', 'no-self-compare': 'error', 'no-sequences': 'error', 'no-shadow-restricted-names': 'error', 'no-sparse-arrays': 'error', 'no-sync': 'error', 'no-tabs': 'error', 'no-template-curly-in-string': 'error', 'no-this-before-super': 'error', 'no-throw-literal': 'error', 'no-trailing-spaces': 'error', 'no-undef': 'error', 'no-undef-init': 'error', 'no-unexpected-multiline': 'error', 'no-unmodified-loop-condition': 'error', 'no-unneeded-ternary': ['error', { defaultAssignment: false }], 'no-unreachable': 'error', 'no-unsafe-finally': 'error', 'no-unsafe-negation': 'error', 'no-unused-expressions': [ 'error', { allowShortCircuit: true, allowTaggedTemplates: true, allowTernary: true, }, ], 'no-unused-vars': ['error', { ignoreRestSiblings: true }], 'no-use-before-define': [ 'error', { classes: false, functions: false, variables: false }, ], 'no-useless-call': 'error', 'no-useless-computed-key': 'error', 'no-useless-constructor': 'error', 'no-useless-escape': 'error', 'no-useless-rename': 'error', 'no-useless-return': 'error', 'no-var': 'error', 'no-with': 'error', 'node/no-deprecated-api': 'error', 'node/process-exit-as-throw': 'error', 'object-shorthand': 'error', 'prefer-const': ['error', { destructuring: 'all' }], 'prefer-destructuring': 'warn', 'prefer-rest-params': 'error', 'prefer-spread': 'error', 'prefer-template': 'error', 'prettier/prettier': ['error'], 'promise/param-names': 'error', 'react/default-props-match-prop-types': 'error', /* * Enable this rule to prevent props like className and styles * from being passed into a custom component */ // 'react/forbid-component-props': 'error', /* * Enable this rule if we want to force devs to use specific * wrapper components instead of native HTML elements */ // 'react/forbid-elements': ['error', ['button']], 'react/forbid-foreign-prop-types': 'error', 'react/forbid-prop-types': 'warn', 'react/jsx-boolean-value': 'error', 'react/jsx-handler-names': 'error', 'react/jsx-no-bind': [ 'error', { allowArrowFunctions: true, allowBind: false, ignoreRefs: true, }, ], 'react/jsx-no-duplicate-props': 'error', 'react/jsx-no-undef': 'error', 'react/jsx-pascal-case': 'error', 'react/jsx-sort-props': [ 'error', { ignoreCase: true, }, ], 'react/jsx-uses-react': 'error', 'react/jsx-uses-vars': 'error', /* * Note: this rule only applies to an inline cb to Array.prototype.map */ 'react/no-array-index-key': 'warn', 'react/no-children-prop': 'error', 'react/no-danger': 'error', 'react/no-did-update-set-state': 'error', 'react/no-direct-mutation-state': 'error', /* * Enable this rule to keep component files simple */ 'react/no-multi-comp': ['warn', { ignoreStateless: true }], 'react/no-redundant-should-component-update': 'error', 'react/no-render-return-value': 'error', 'react/no-string-refs': 'error', 'react/no-this-in-sfc': 'error', 'react/no-typos': 'error', 'react/no-unknown-property': 'error', 'react/no-unused-prop-types': 'error', 'react/no-unused-state': 'error', 'react/prefer-es6-class': 'error', 'react/prop-types': 'error', 'react/react-in-jsx-scope': 'error', 'react/require-default-props': 'error', 'react/require-render-return': 'error', 'react/self-closing-comp': 'error', 'react/void-dom-elements-no-children': 'error', 'require-yield': 'error', // 'sort-keys': ['warn', 'asc', { caseSensitive: false, natural: true }], 'symbol-description': 'error', 'unicode-bom': ['error', 'never'], 'use-isnan': 'error', 'valid-jsdoc': 'error', 'valid-typeof': 'error', 'wrap-iife': ['error', 'inside'], yoda: 'error', }, settings: { react: { version: 'latest', }, }, overrides: [ { files: ['*.ts', '*.tsx'], rules: { 'react/prop-types': 'off', }, }, ], }