-
Notifications
You must be signed in to change notification settings - Fork 10
/
.eslintrc.js
41 lines (41 loc) · 1.01 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
module.exports = {
"root": true,
"env": {
"browser": true,
"node": true,
"es6": true,
// "jquery": true
"jest": true,
"jsx-control-statements/jsx-control-statements": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": 'module',
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
}
},
"globals": {
// "wx": "readonly",
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:jsx-control-statements/recommended", // 需要另外配合babel插件使用
"prettier"
],
"settings": {
"react": {
"version": "detect"
}
},
"plugins": ["@typescript-eslint", "react", "jsx-control-statements", "prettier"],
"rules": {
"prettier/prettier": 1,
"no-extra-semi": 2, // 禁止不必要的分号
"quotes": ['error', 'single'], // 强制使用单引号
"no-unused-vars": 0, // 不允许未定义的变量
"jsx-control-statements/jsx-use-if-tag": 0
}
};