-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
52 lines (52 loc) · 1.84 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
const path = require('path');
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:react/recommended',
'plugin:jsx-control-statements/recommended'
],
'settings': {
'react': {
'version': 'detect'
}
},
plugins: ['@typescript-eslint', 'react', 'jsx-control-statements', 'react-hooks'],
env: {
browser: true,
node: true,
es6: true,
mocha: true,
'jsx-control-statements/jsx-control-statements': true
},
globals: {
},
// 配置自定义规则
rules: {
'@typescript-eslint/indent': ['error', 2],
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/interface-name-prefix': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-triple-slash-reference': 0,
'@typescript-eslint/triple-slash-reference': ['error', { path: 'always', types: 'never', lib: 'never' }],
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/camelcase': 0,
'no-console': ['warn', { allow: ['warn', 'error'] }],
'comma-dangle': 0,
'semi': ['warn', 'always'],
'eqeqeq': ['warn', 'always'],
'react/jsx-indent': [2, 2],
'react/jsx-no-undef': [2, { allowGlobals: true }],
'jsx-control-statements/jsx-use-if-tag': 0,
'jsx-control-statements/jsx-jcs-no-undef': 0,
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/prop-types": 0,
"@typescript-eslint/explicit-module-boundary-types": 0
}
};