|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + es2020: true, |
| 5 | + node: true, |
| 6 | + jest: true, |
| 7 | + }, |
| 8 | + extends: [ |
| 9 | + 'plugin:react/recommended', |
| 10 | + 'airbnb', |
| 11 | + 'plugin:jest/recommended', |
| 12 | + 'plugin:prettier/recommended', |
| 13 | + 'plugin:@typescript-eslint/recommended', |
| 14 | + ], |
| 15 | + settings: { |
| 16 | + 'import/resolver': { |
| 17 | + node: { |
| 18 | + extensions: ['.js', '.jsx', '.ts', '.tsx'], |
| 19 | + paths: ['./'], |
| 20 | + }, |
| 21 | + }, |
| 22 | + }, |
| 23 | + parser: '@typescript-eslint/parser', |
| 24 | + parserOptions: { |
| 25 | + parserOptions: { |
| 26 | + ecmaVersion: 2020, |
| 27 | + }, |
| 28 | + ecmaFeatures: { |
| 29 | + jsx: true, |
| 30 | + }, |
| 31 | + ecmaVersion: 11, |
| 32 | + sourceType: 'module', |
| 33 | + }, |
| 34 | + plugins: ['react', '@typescript-eslint', 'import', 'jsx-a11y', 'prettier'], |
| 35 | + rules: { |
| 36 | + 'linebreak-style': 'off', // Неправильно работает в Windows. |
| 37 | + |
| 38 | + 'arrow-parens': 'off', // Несовместимо с prettier |
| 39 | + 'object-curly-newline': 'off', // Несовместимо с prettier |
| 40 | + 'no-mixed-operators': 'off', // Несовместимо с prettier |
| 41 | + // 'arrow-body-style': 'off', // Это - не наш стиль? |
| 42 | + 'function-paren-newline': 'off', // Несовместимо с prettier |
| 43 | + 'no-plusplus': 'off', |
| 44 | + 'space-before-function-paren': 0, // Несовместимо с prettier |
| 45 | + |
| 46 | + 'max-len': ['error', 130, 2, { ignoreUrls: true }], // airbnb позволяет некоторые пограничные случаи |
| 47 | + 'no-console': 'error', // airbnb использует предупреждение |
| 48 | + 'no-alert': 'error', // airbnb использует предупреждение |
| 49 | + |
| 50 | + 'no-param-reassign': 'off', // Это - не наш стиль? |
| 51 | + radix: 'off', // parseInt, parseFloat и radix выключены. Мне это не нравится. |
| 52 | + |
| 53 | + 'react/require-default-props': 'off', // airbnb использует уведомление об ошибке |
| 54 | + 'react/forbid-prop-types': 'off', // airbnb использует уведомление об ошибке |
| 55 | + |
| 56 | + 'prefer-destructuring': 'off', |
| 57 | + |
| 58 | + 'react/no-find-dom-node': 'off', // Я этого не знаю |
| 59 | + 'react/no-did-mount-set-state': 'off', |
| 60 | + 'react/no-unused-prop-types': 'off', // Это всё ещё работает нестабильно |
| 61 | + 'react/jsx-one-expression-per-line': 'off', |
| 62 | + |
| 63 | + 'jsx-a11y/anchor-is-valid': ['error', { components: ['Link'], specialLink: ['to'] }], |
| 64 | + 'jsx-a11y/label-has-for': [ |
| 65 | + 2, |
| 66 | + { |
| 67 | + required: { |
| 68 | + every: ['id'], |
| 69 | + }, |
| 70 | + }, |
| 71 | + ], // для ошибки вложенных свойств htmlFor элементов label |
| 72 | + |
| 73 | + 'prettier/prettier': ['error'], |
| 74 | + |
| 75 | + 'import/order': [ |
| 76 | + 'error', |
| 77 | + { |
| 78 | + groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], |
| 79 | + warnOnUnassignedImports: true, |
| 80 | + 'newlines-between': 'always-and-inside-groups', |
| 81 | + pathGroups: [ |
| 82 | + { |
| 83 | + pattern: '**/*.scss', |
| 84 | + group: 'index', |
| 85 | + position: 'after', |
| 86 | + }, |
| 87 | + { |
| 88 | + pattern: './assets/**', |
| 89 | + group: 'sibling', |
| 90 | + position: 'before', |
| 91 | + }, |
| 92 | + ], |
| 93 | + }, |
| 94 | + ], |
| 95 | + |
| 96 | + 'import/no-extraneous-dependencies': 'off', |
| 97 | + 'jsx-a11y/click-events-have-key-events': 'off', |
| 98 | + 'react/jsx-key': 'error', |
| 99 | + '@typescript-eslint/no-var-requires': 'off', |
| 100 | + 'react/jsx-no-target-blank': 'error', |
| 101 | + 'jsx-a11y/no-static-element-interactions': 'off', |
| 102 | + 'react/prop-types': 'off', |
| 103 | + camelcase: 'off', |
| 104 | + indent: [2, 'tab'], |
| 105 | + 'react/jsx-indent': [2, 'tab'], |
| 106 | + 'react/jsx-indent-props': [2, 'tab'], |
| 107 | + 'no-tabs': 'off', |
| 108 | + 'import/no-unresolved': 'warn', |
| 109 | + 'object-curly-spacing': 'off', |
| 110 | + 'react/jsx-filename-extension': [1, { extensions: ['.tsx'] }], |
| 111 | + 'import/extensions': 'off', |
| 112 | + 'no-unused-vars': 'off', |
| 113 | + '@typescript-eslint/no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: false }], |
| 114 | + 'react/jsx-props-no-spreading': 'off', |
| 115 | + 'no-autofocus': 'off', |
| 116 | + 'no-underscore-dangle': 'off', |
| 117 | + 'jsx-a11y/label-has-associated-control': [2, { assert: 'either', depth: 25 }], |
| 118 | + }, |
| 119 | +}; |
0 commit comments