|
1 | 1 | module.exports = {
|
2 |
| - env: { |
3 |
| - browser: true, |
4 |
| - es2021: true, |
5 |
| - }, |
6 | 2 | extends: [
|
| 3 | + 'airbnb-base', |
| 4 | + 'prettier', // eslint-config-prettier 处理冲突 |
7 | 5 | 'plugin:react/recommended',
|
8 |
| - 'airbnb', |
| 6 | + 'plugin:import/typescript', |
| 7 | + 'plugin:@typescript-eslint/recommended', |
9 | 8 | ],
|
10 | 9 | parser: '@typescript-eslint/parser',
|
| 10 | + plugins: ['@typescript-eslint', 'react-hooks'], |
| 11 | + env: { |
| 12 | + browser: true, |
| 13 | + node: true, |
| 14 | + jest: true, |
| 15 | + }, |
| 16 | + settings: { |
| 17 | + react: { |
| 18 | + pragma: 'React', |
| 19 | + version: 'detect', |
| 20 | + }, |
| 21 | + }, |
11 | 22 | parserOptions: {
|
| 23 | + ecmaVersion: 2019, |
| 24 | + sourceType: 'module', |
12 | 25 | ecmaFeatures: {
|
13 | 26 | jsx: true,
|
14 | 27 | },
|
15 |
| - ecmaVersion: 13, |
16 |
| - sourceType: 'module', |
17 | 28 | },
|
18 |
| - plugins: [ |
19 |
| - 'react', |
20 |
| - '@typescript-eslint', |
21 |
| - ], |
22 | 29 | rules: {
|
| 30 | + 'no-use-before-define': 'off', |
| 31 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 32 | + '@typescript-eslint/ban-types': 'off', |
| 33 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 34 | + '@typescript-eslint/indent': ['off', 2], |
| 35 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 36 | + '@typescript-eslint/camelcase': 'off', |
| 37 | + '@typescript-eslint/no-empty-interface': 'error', // codecc |
| 38 | + '@typescript-eslint/no-explicit-any': 'off', |
| 39 | + '@typescript-eslint/no-use-before-define': ['error', { functions: false }], |
| 40 | + '@typescript-eslint/no-var-requires': 'off', |
| 41 | + '@typescript-eslint/no-unused-vars': 'error', // codecc |
| 42 | + 'import/order': 'error', |
| 43 | + 'import/extensions': 'off', |
| 44 | + 'import/no-named-as-default': 'off', |
| 45 | + 'import/prefer-default-export': 'off', |
| 46 | + 'import/no-extraneous-dependencies': 'off', |
| 47 | + 'import/no-cycle': 'off', // TODO: turn on this rule later |
| 48 | + 'import/no-unresolved': 'off', // TODO: turn on this rule later |
| 49 | + 'react/display-name': 'off', |
| 50 | + 'react-hooks/exhaustive-deps': 'warn', |
| 51 | + 'react-hooks/rules-of-hooks': 'error', |
| 52 | + 'react/prop-types': 'off', |
| 53 | + 'max-len': 'off', |
| 54 | + 'no-shadow': 'off', |
| 55 | + 'no-console': 'off', |
| 56 | + 'no-throw-literal': 'off', |
| 57 | + 'no-unused-expressions': 'off', |
| 58 | + 'no-bitwise': 'off', |
| 59 | + 'no-useless-return': 'off', |
| 60 | + 'no-plusplus': [ |
| 61 | + 'error', |
| 62 | + { |
| 63 | + allowForLoopAfterthoughts: true, |
| 64 | + }, |
| 65 | + ], |
| 66 | + 'no-continue': 'off', |
| 67 | + 'no-return-assign': 'off', |
| 68 | + 'no-restricted-syntax': 'off', |
| 69 | + 'no-restricted-globals': 'off', |
| 70 | + 'no-unneeded-ternary': 'off', |
| 71 | + 'eol-last': 'error', // codecc |
| 72 | + 'func-names': 'off', |
| 73 | + 'consistent-return': 'off', |
| 74 | + 'default-case': 'off', |
23 | 75 | },
|
24 | 76 | };
|
0 commit comments