-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
42 lines (42 loc) · 939 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
39
40
41
42
module.exports = {
parser: "babel-eslint",
env: {
browser: true,
node: true,
commonjs: true,
es6: true
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"prettier"
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: "module",
allowImportExportEverywhere: false,
codeFrame: true
},
plugins: ["react", "react-hooks", "babel"],
rules: {
"no-console": 1,
"no-unused-vars": 0,
"react/prop-types": 0,
"react-hooks/rules-of-hooks": "error", // 检查 Hook 的规则
"react-hooks/exhaustive-deps": "warn", // 检查 effect 的依赖
"babel/new-cap": 1,
"babel/camelcase": 1,
"babel/no-invalid-this": 1,
"babel/quotes": 1,
"babel/semi": 1,
"babel/no-unused-expressions": 0,
"babel/valid-typeof": 1
}
};