|
| 1 | +const prettierConfig = require('./.prettierrc'); |
| 2 | + |
| 3 | +module.exports = { |
| 4 | + extends: [ |
| 5 | + 'plugin:react/recommended', |
| 6 | + 'airbnb', |
| 7 | + 'airbnb-typescript', |
| 8 | + 'airbnb/hooks', |
| 9 | + 'plugin:@typescript-eslint/recommended', |
| 10 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 11 | + 'plugin:prettier/recommended', |
| 12 | + ], |
| 13 | + parserOptions: { |
| 14 | + project: './tsconfig.json', |
| 15 | + sourceType: 'module', |
| 16 | + ecmaVersion: 2018, |
| 17 | + ecmaFeatures: { |
| 18 | + jsx: true, |
| 19 | + }, |
| 20 | + }, |
| 21 | + settings: { |
| 22 | + 'import/parsers': { |
| 23 | + '@typescript-eslint/parser': ['.ts', '.tsx'], |
| 24 | + }, |
| 25 | + 'import/resolver': { |
| 26 | + typescript: {}, |
| 27 | + }, |
| 28 | + react: { |
| 29 | + version: 'detect', |
| 30 | + }, |
| 31 | + }, |
| 32 | + plugins: [ |
| 33 | + '@typescript-eslint/eslint-plugin', |
| 34 | + 'react', |
| 35 | + 'react-hooks', |
| 36 | + 'import', |
| 37 | + 'prettier' |
| 38 | + ], |
| 39 | + rules: { |
| 40 | + 'prettier/prettier': ['error', prettierConfig], |
| 41 | + 'max-len': [ |
| 42 | + 'error', |
| 43 | + { |
| 44 | + code: 120, |
| 45 | + ignoreComments: true, |
| 46 | + ignoreUrls: true, |
| 47 | + ignoreTemplateLiterals: true, |
| 48 | + ignoreRegExpLiterals: true, |
| 49 | + } |
| 50 | + ], |
| 51 | + 'object-curly-newline': 'off', |
| 52 | + 'class-methods-use-this': 'off', |
| 53 | + 'import/prefer-default-export': 'off', |
| 54 | + 'import/first': 'error', |
| 55 | + 'import/newline-after-import': 'error', |
| 56 | + 'import/no-duplicates': 'error', |
| 57 | + 'import/order': [ |
| 58 | + 'error', |
| 59 | + { |
| 60 | + groups: [ |
| 61 | + 'external', |
| 62 | + 'sibling', |
| 63 | + 'parent', |
| 64 | + 'internal', |
| 65 | + 'builtin', |
| 66 | + 'object', |
| 67 | + 'type', |
| 68 | + 'index', |
| 69 | + ], |
| 70 | + 'newlines-between': 'always', |
| 71 | + }, |
| 72 | + ], |
| 73 | + '@typescript-eslint/explicit-member-accessibility': 'off', |
| 74 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 75 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 76 | + '@typescript-eslint/no-explicit-any': 'off', |
| 77 | + '@typescript-eslint/ban-types': 'off', |
| 78 | + '@typescript-eslint/no-var-requires': 'off', |
| 79 | + '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], |
| 80 | + '@typescript-eslint/no-floating-promises': 'off', |
| 81 | + 'linebreak-style': 'off', |
| 82 | + 'no-underscore-dangle': ['error', { 'allow': ['_id', '__ENV'] }], |
| 83 | + 'arrow-parens': ['error', 'always'], |
| 84 | + 'no-void': ['error', { allowAsStatement: true }], |
| 85 | + '@typescript-eslint/no-use-before-define': 'off', |
| 86 | + 'import/no-extraneous-dependencies': 'off', |
| 87 | + 'react/jsx-props-no-spreading': 'off', |
| 88 | + 'react/react-in-jsx-scope': 'off', |
| 89 | + 'react/prop-types': 'off', |
| 90 | + 'react/require-default-props': 'off', |
| 91 | + 'react/function-component-definition': [ |
| 92 | + 'error', |
| 93 | + { |
| 94 | + namedComponents: 'arrow-function', |
| 95 | + unnamedComponents: 'arrow-function', |
| 96 | + }, |
| 97 | + ], |
| 98 | + 'react/jsx-first-prop-new-line': ['warn', 'multiline'], |
| 99 | + 'react/jsx-closing-bracket-location': [ |
| 100 | + 'warn', |
| 101 | + 'tag-aligned', |
| 102 | + ], |
| 103 | + 'react/jsx-max-props-per-line': [ |
| 104 | + 'warn', |
| 105 | + { maximum: 1, when: 'multiline' }, |
| 106 | + ], |
| 107 | + 'react/jsx-indent-props': ['warn', 2], |
| 108 | + 'no-param-reassign': ['error', { 'props': true, 'ignorePropertyModificationsForRegex': ['^figma'] }], |
| 109 | + 'react/jsx-no-useless-fragment': 'off', |
| 110 | + '@typescript-eslint/unbound-method': 'off', |
| 111 | + }, |
| 112 | +}; |
0 commit comments