-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc.js
38 lines (38 loc) · 960 Bytes
/
.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
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parser: '@typescript-eslint/parser',
extends: [
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: ['react', 'react-hooks', '@typescript-eslint'],
settings: {
react: {
version: 'latest',
},
},
rules: {
'react-hooks/rules-of-hooks': 2, // 检查 Hook 的规则
'react-hooks/exhaustive-deps': 1, // 检查 effect 的依赖
'react/prop-types': 1,
'no-unused-vars': 0,
'arrow-parens': 0,
'implicit-arrow-linebreak': 0,
'function-paren-newline': 0,
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
};