|
| 1 | +module.exports = { |
| 2 | + extends: [ |
| 3 | + 'airbnb', |
| 4 | + 'prettier', |
| 5 | + 'plugin:@typescript-eslint/eslint-recommended', |
| 6 | + 'plugin:@typescript-eslint/recommended', |
| 7 | + 'plugin:react/recommended', |
| 8 | + 'plugin:react/jsx-runtime', |
| 9 | + ], |
| 10 | + env: { |
| 11 | + browser: true, |
| 12 | + node: true, |
| 13 | + jest: true, |
| 14 | + es6: true, |
| 15 | + }, |
| 16 | + plugins: ['@typescript-eslint', 'prettier', 'react', 'react-hooks'], |
| 17 | + parserOptions: { |
| 18 | + project: ['tsconfig.eslint.json'], |
| 19 | + tsconfigRootDir: __dirname, |
| 20 | + }, |
| 21 | + rules: { |
| 22 | + '@typescript-eslint/no-empty-function': 0, |
| 23 | + '@typescript-eslint/no-explicit-any': 0, |
| 24 | + '@typescript-eslint/ban-ts-comment': [ |
| 25 | + 'error', |
| 26 | + { 'ts-ignore': 'allow-with-description' }, |
| 27 | + ], |
| 28 | + 'prettier/prettier': 'error', |
| 29 | + 'react-hooks/rules-of-hooks': 'error', |
| 30 | + 'react-hooks/exhaustive-deps': 'error', |
| 31 | + 'consistent-return': 0, |
| 32 | + 'padded-blocks': 0, |
| 33 | + 'spaced-comment': 0, |
| 34 | + semi: ['error', 'always'], |
| 35 | + quotes: [ |
| 36 | + 'error', |
| 37 | + 'single', |
| 38 | + { |
| 39 | + avoidEscape: true, |
| 40 | + allowTemplateLiterals: true, |
| 41 | + }, |
| 42 | + ], |
| 43 | + 'arrow-body-style': [0], |
| 44 | + 'class-methods-use-this': 0, |
| 45 | + 'comma-dangle': [ |
| 46 | + 'error', |
| 47 | + { |
| 48 | + arrays: 'only-multiline', |
| 49 | + objects: 'only-multiline', |
| 50 | + imports: 'only-multiline', |
| 51 | + exports: 'only-multiline', |
| 52 | + functions: 'ignore', |
| 53 | + }, |
| 54 | + ], |
| 55 | + 'function-paren-newline': 0, |
| 56 | + 'import/extensions': 0, |
| 57 | + 'import/imports-first': 0, |
| 58 | + 'import/newline-after-import': 0, |
| 59 | + 'import/no-dynamic-require': 0, |
| 60 | + 'import/no-extraneous-dependencies': 0, |
| 61 | + 'import/no-named-as-default': 0, |
| 62 | + 'import/no-unresolved': 2, |
| 63 | + 'import/no-webpack-loader-syntax': 0, |
| 64 | + 'import/prefer-default-export': 0, |
| 65 | + 'jsx-a11y/mouse-events-have-key-events': 0, |
| 66 | + 'lines-between-class-members': 0, |
| 67 | + 'newline-per-chained-call': 0, |
| 68 | + 'no-confusing-arrow': 0, |
| 69 | + 'no-console': 1, |
| 70 | + 'no-underscore-dangle': 0, |
| 71 | + 'no-use-before-define': 0, |
| 72 | + 'no-param-reassign': 1, |
| 73 | + 'no-plusplus': 0, |
| 74 | + 'no-prototype-builtins': 0, |
| 75 | + 'no-shadow': 1, |
| 76 | + 'object-curly-newline': 0, |
| 77 | + 'one-var': 0, |
| 78 | + 'one-var-declaration-per-line': [2, 'initializations'], |
| 79 | + 'prefer-destructuring': 1, |
| 80 | + 'prefer-template': 2, |
| 81 | + 'react/destructuring-assignment': 1, |
| 82 | + 'react/forbid-prop-types': [1, { forbid: ['any', 'array'] }], |
| 83 | + 'react/function-component-definition': 0, |
| 84 | + 'react/jsx-curly-brace-presence': 0, |
| 85 | + 'react/jsx-filename-extension': [ |
| 86 | + 1, |
| 87 | + { extensions: ['.js', '.jsx', '.ts', '.tsx'] }, |
| 88 | + ], |
| 89 | + 'react/jsx-props-no-spreading': 0, |
| 90 | + 'react/no-children-prop': 1, |
| 91 | + 'react/no-did-update-set-state': 0, |
| 92 | + 'react/require-default-props': 0, |
| 93 | + 'react/sort-comp': [ |
| 94 | + 1, |
| 95 | + { |
| 96 | + order: [ |
| 97 | + 'static-methods', |
| 98 | + 'instance-variables', |
| 99 | + 'lifecycle', |
| 100 | + 'render', |
| 101 | + '/^render.+$/', |
| 102 | + '/^on.+$/', |
| 103 | + '/^handle.+$/', |
| 104 | + 'everything-else', |
| 105 | + ], |
| 106 | + }, |
| 107 | + ], |
| 108 | + }, |
| 109 | + settings: { |
| 110 | + 'import/resolver': { |
| 111 | + typescript: {}, |
| 112 | + }, |
| 113 | + }, |
| 114 | +}; |
0 commit comments