-
Notifications
You must be signed in to change notification settings - Fork 143
/
.eslintrc
56 lines (56 loc) · 1.63 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
50
51
52
53
54
55
56
{
"extends": "airbnb",
"env": {
"browser": true,
"node": true,
"es6": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true,
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": false,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": false,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true
}
},
"rules": {
/**
* References
* http://www.cnblogs.com/qianlegeqian/p/4728170.html
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/base/index.js
*/
"allowForLoopAfterthoughts": true,
"no-underscore-dangle": 0,
"no-console": "off",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"semi": [2, "always"], // 句尾強制分號
"curly": 0,
"radix": 2,
"brace-style": 0,
"consistent-this": 0,
"indent": [2, 2],
"no-lonely-if": 2,
"no-nested-ternary": 2,
"no-use-before-define": [2, "nofunc"],
"space-after-keywords": "off",
"keyword-spacing": [2, { "before": true, "after": true }],
"space-before-blocks": [2, "always"], // 大括號前要有空白
"space-in-parens": [2, "never"], // 小括號內(前後)不得有空白
"space-unary-ops": 2,
"no-mixed-spaces-and-tabs": [2, false] // 禁止混用 space & tab
}
}