-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
50 lines (49 loc) · 1.44 KB
/
.eslintrc
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
{
"root": true,
"env": {
"commonjs": true,
"node": true,
"es6": true,
"browser": true
},
"extends": [
"eslint:recommended", // 启用推荐的规则
"plugin:react/recommended", // 该插件会导出建议的配置,以强制实施 React 的良好做法。
"plugin:jsx-a11y/recommended",
"plugin:prettier/recommended",
"prettier/react",
"prettier/vue"
],
"parser": "babel-eslint", // 一个对 Babel 解析器的包装,使其能够与 ESLint 兼容
"plugins": [
"react",
"jsx-a11y",
"react-hooks",
"import" // 该插件旨在支持ES2015 +(ES6 +)导入/导出语法的检查,并防止文件路径和导入名称拼写错误的问题。
],
"rules": {
"semi": ["error", "always"],
"quotes": ["error", "single"],
"camelcase": [0, { "properties": "never" }],
"no-console": [2, { "allow": ["warn", "error"] }],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/jsx-props-no-spreading": "off",
"jsx-a11y/click-events-have-key-events": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/no-unused-prop-types": "off"
},
"settings": {
// "react": {
// "version": "16.10.2"
// },
"import/resolver": "webpack"
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
// "process": true,
// "module": true
// "require": true
}
}