-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc.js
88 lines (87 loc) · 2.67 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
77
78
79
80
81
82
83
84
85
86
87
88
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
// 'plugin:react/recommended',
'plugin:react-hooks/recommended',
'airbnb-base',
'airbnb/hooks',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['react', '@typescript-eslint'],
rules: {
'max-len': 'off',
'no-bitwise': 'off',
'eol-last': 'off',
'padded-blocks': 'off',
'no-undef': 'off', // disable the no-undef rule because typescript has already its own checks
'no-unused-vars': 'off',
'no-console': 'off',
'operator-linebreak': 'off',
'no-restricted-imports': 'off',
'no-use-before-define': 'off',
'max-classes-per-file': 'off',
'object-curly-newline': 'off', // 花括号需要分多行
'prefer-destructuring': 'off',
'no-template-curly-in-string': 'off',
'import/no-extraneous-dependencies': 'off',
'import/order': 'off',
'import/prefer-default-export': 'off',
'import/no-unresolved': 'off',
'import/extensions': 'off',
'space-before-function-paren': [
'off',
{
anonymous: 'always',
named: 'always',
asyncArrow: 'always',
},
],
'quote-props': ['error', 'consistent-as-needed'],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-interface': 'off',
// 'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.ts', '.jsx', '.tsx'] }],
// 'react/button-has-type': 'off',
// 'jsx-a11y/anchor-is-valid': ['warn'],
// 'jsx-a11y/click-events-have-key-events': ['warn'],
// todo
'global-require': 'off',
'@typescript-eslint/no-var-requires': 'off',
'no-nested-ternary': 'off',
'implicit-arrow-linebreak': 'off',
'@typescript-eslint/no-namespace': 'off',
'no-dupe-class-members': 'off',
'no-continue': 'off',
'no-param-reassign': 'off',
'no-case-declarations': 'off',
'no-await-in-loop': 'off',
'no-mixed-operators': 'off',
'no-prototype-builtins': 'off',
'no-underscore-dangle': 'off',
'prefer-spread': 'off',
'camelcase': 'off',
'no-plusplus': 'off',
'no-redeclare': 'off',
'class-methods-use-this': 'off',
'react-hooks/exhaustive-deps': 'off',
'no-restricted-syntax': 'off',
'consistent-return': 'off',
'no-shadow': 'off',
'no-angle-bracket-type-assertion': 'off',
},
};