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