/
.eslintrc
169 lines (168 loc) · 5.18 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
"env": {
"browser": true,
"node": true
},
"parser": "babel-eslint",
"extends": ["eslint:recommended", "plugin:react/recommended"],
"plugins": [
"react"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"globals": {
"Symbol": false,
"CALL_API": false,
# "Promise": false,
"Global": false,
"Util": false,
"Sdk": false,
"ActiveXObject": false,
# 测试相关
"describe": false,
"it": false,
"expect": false,
"assert": false,
"pajkPostMessage": false
},
"rules": {
"comma-dangle": 0,
"eol-last": 0,
"global-require": 0,
# "indent": [2, "tab"],
# "indent": 0,
"max-len": 0,
"no-else-return": 0,
"no-underscore-dangle": 0,
"object-shorthand": 0,
"no-shadow": 0,
"no-process-env": 0,
"no-alert": 1,
"no-console": 1,
"no-debugger": 1,
"arrow-body-style": [2, "as-needed"],
"array-bracket-spacing": [2, "always", { "singleValue": false, "objectsInArrays": false }],
# "arrow-parens": [2, "as-needed"],
"arrow-spacing": [2,{ "before": true, "after": true }],
"comma-spacing": [2, { "before": false, "after": true }],
"computed-property-spacing": [2, "never"],
"consistent-this": [2, "self"],
"consistent-return": 2,
"eqeqeq": [2, "smart"],
"func-names": 0,
"generator-star-spacing": [2, {"before": true, "after": false}],
"guard-for-in": 2,
"id-length": [0, { "min": 2, "properties": "always", "exceptions": ["i", "j", "k", "m", "n", "e", "_", "v", "x", "y"] }],
# "indent": [2, 2, {"VariableDeclarator": 1, "SwitchCase": 1}],
# "indent": [2, "tab", {"SwitchCase": 1}],
"jsx-quotes": [2, "prefer-double"],
"key-spacing": [2, {
"beforeColon": false,
"afterColon": true
# "singleLine": {
# "beforeColon": false,
# "afterColon": true
# },
# "multiLine": {
# "beforeColon": true,
# "afterColon": true,
# "align": "colon"
# }
}],
"keyword-spacing": 2,
# "new-paren": 2,
"lines-around-comment": [1, { "beforeBlockComment": true, "afterBlockComment": false, "beforeLineComment": false, "afterLineComment": false }],
"no-array-constructor": 2,
"no-caller": 2,
# "no-cap": [2, { "capIsNew": false, "newIsCapExceptions": ["events"], "properties": false }],
"no-catch-shadow": 2,
"no-extra-bind": 0,
"no-extra-parens": [1, "functions"],
"no-eval": 2,
"no-fallthrough": 1,
"no-implicit-coercion": 2,
# "no-invalid-this": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-lone-blocks": 2,
"no-loop-func": 1,
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"no-multiple-empty-lines": [2, {"max": 2}],
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-native-reassign": [2, {"exceptions": ["Object"]}],
"no-negated-condition": 1,
"no-new-object": 2,
"no-new-func": 2,
"no-new-symbol": 2,
"no-new-wrappers": 2,
"no-param-reassign": [2, { "props": false }],
"no-restricted-syntax": [2, "WithStatement"],
"no-shadow-restricted-names": 2,
"no-undef": [2, { "typeof": true}], # , "except": ["Symbol"]
"no-undefined": 2,
"no-undef-init": 2,
"no-unneeded-ternary": 2,
"no-unused-expressions": [2, { "allowShortCircuit": true, "allowTernary": true }],
"no-unused-vars": [1, { "caughtErrors": "none", "argsIgnorePattern": "^err|^store" }],
"no-use-before-define": 2,
"no-useless-call": 2,
"no-useless-constructor": 2,
"no-var": 1,
"object-curly-spacing": [2, "always"],
"one-var": [2, { let: "never", const: "never" }],
"prefer-arrow-callback": 2,
"prefer-const": [2, {"destructuring": "all"}],
"prefer-spread": 2,
"prefer-template": 2,
"quotes": [2, "single"],
"quote-props": [2, "as-needed"],
"radix": [2, "as-needed"],
"semi": 1,
"spaced-comment": [2, "always"],
"space-before-blocks": 2,
"space-before-function-paren": [2, "never"],
"space-infix-ops": [2, {"int32Hint": true}],
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"template-curly-spacing": [2, "never"],
"wrap-iife": [2, "inside"],
"wrap-regex": 1,
"react/jsx-curly-spacing": 0,
"react/jsx-equals-spacing": [2, "never"],
"react/jsx-key": 2,
"react/jsx-handler-names": 2,
"react/jsx-indent": 0,
"react/jsx-no-bind": 0,
"react/jsx-no-literals": 0,
"react/jsx-space-before-closing": [2, "always"],
"react/no-danger": 1,
"react/no-deprecated": 1,
"react/no-did-mount-set-state": 0,
"react/no-did-update-set-state": 0,
"react/no-multi-comp": 0,
"react/no-string-refs": 0,
"react/prefer-es6-class": [2, "always"],
"react/prefer-stateless-function": 1,
"react/require-extension": 0,
"react/require-render-return": 2,
"react/self-closing-comp": 2,
# "react/sort-comp": [1, { order: [ 'lifecycle', '/^on.+$/', 'everything-else', 'render' ] }],
"react/sort-comp": [1, {
order: [
'static-methods',
'lifecycle',
'/^init.+$/',
'/^on.+$/',
'/^handle.+$/',
'everything-else',
'/^render.+$/',
'render',
'/^attach.+$/',
'/^detach.+$/',
]
}],
}
}