-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
191 lines (180 loc) · 6.59 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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
module.exports = {
"parser": "babel-eslint",
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:react/recommended",
"standard",
"standard-react"
],
"plugins": [
"babel",
"promise",
"react"
],
"settings": {
},
"globals": {
"__DEV__": false,
"__PROD__": false,
"__DEBUG__": false,
"__COVERAGE__": false,
"__BASENAME__": false
},
"rules": {
"indent": ["error", 4, {"SwitchCase": 1}],
"comma-dangle": ["error", "always-multiline"],
"space-before-function-paren": ["error", "never"],
"camelcase": "off",
"no-param-reassign": "off",
"brace-style": ["error", "stroustrup"],
"no-console": "off",
"no-multi-spaces": "off",
// http://eslint.org/docs/rules/#possible-errors
"no-prototype-builtins": "error",
"valid-jsdoc": "off",
// http://eslint.org/docs/rules/#best-practices
"array-callback-return": "error",
"block-scoped-var": "error",
"complexity": "off",
"consistent-return": "error",
"default-case": "off",
"dot-notation": "error",
"guard-for-in": "error",
"no-alert": "error",
"no-div-regex": "off",
"no-else-return": "error",
"no-empty-function": "error",
"no-eq-null": "error",
"no-extra-label": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-invalid-this": "off",
"no-loop-func": "error",
//"no-magic-numbers": [ "error", { "ignore": [ -1, 0, 1 ] } ],
"no-restricted-globals": [ "error", "event" ],
"no-script-url": "error",
"no-unused-expressions": [ "error", { "allowShortCircuit": true, "allowTernary": true } ],
"no-useless-concat": "error",
"no-void": "error",
"no-warning-comments": "off",
"radix": "error",
"rest-spread-spacing": "error",
"vars-on-top": "error",
// http://eslint.org/docs/rules/#strict-mode
"strict": "error",
// http://eslint.org/docs/rules/#variables
"init-declarations": "error",
"no-catch-shadow": "off",
//"no-shadow": [ "error", { "builtinGlobals": true, "hoist": "all" } ],
// http://eslint.org/docs/rules/#nodejs-and-commonjs
"callback-return": "off",
"global-require": "off",
"no-mixed-requires": "error",
"no-process-env": "error",
"no-process-exit": "error",
"no-restricted-modules": "off",
"no-sync": "error",
"no-undefined": "off",
"no-use-before-define": [ "error", { "functions": false } ],
// http://eslint.org/docs/rules/#stylistic-issues
"computed-property-spacing": [ "error", "never" ],
"consistent-this": [ "error", "self" ],
"func-names": "error",
"func-style": [ "error", "declaration", { "allowArrowFunctions": true } ],
"id-blacklist": "off",
"id-length": [ "warn", { "min": 1, "max": 30 } ],
"id-match": "off",
"linebreak-style": [ "error", "unix" ],
"lines-around-comment": "off",
"max-depth": [ "warn", { "max": 4 } ],
//"max-len": [ "error", { "code": 100, "tabWidth": 4 } ],
//"max-lines": [ "warn", { "max": 100 } ],
"max-nested-callbacks": "off",
"max-params": [ "warn", { "max": 5 } ],
"max-statements": [ "warn", { "max": 20 } ],
"max-statements-per-line": [ "error", { "max": 1 } ],
"multiline-ternary": "off",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"no-bitwise": "error",
"no-continue": "off",
"no-inline-comments": "off",
"no-lonely-if": "error",
"no-mixed-operators": "off",
"no-negated-condition": "error",
"no-nested-ternary": "off",
"no-plusplus": "off",
"no-restricted-syntax": "off",
"no-tabs": "error",
"no-ternary": "off",
//"no-underscore-dangle": "error",
"object-curly-newline": "off",
"one-var-declaration-per-line": "error",
"object-property-newline": [ "error", { "allowMultiplePropertiesPerLine": true } ],
"operator-assignment": [ "error", "always" ],
"quote-props": [ "error", "consistent-as-needed" ],
"require-jsdoc": "off",
"sort-vars": "off",
"unicode-bom": "off",
"wrap-regex": "off",
// http://eslint.org/docs/rules/#ecmascript-6
"arrow-body-style": [ "error", "as-needed" ],
"no-confusing-arrow": [ "error", { "allowParens": true } ],
"no-duplicate-imports": "off", // Conflicts with Flow type imports. Using import/no-duplicates instead.
"no-restricted-imports": "off",
"no-useless-rename": "error",
"no-var": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-reflect": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
//"prefer-template": "error",
"sort-imports": "off",
// https://github.com/babel/eslint-plugin-babel#rules
//"babel/array-bracket-spacing": [ "error", "always" ],
"babel/arrow-parens": [ "error", "as-needed" ],
"babel/flow-object-type": [ "error", "comma" ],
"babel/func-params-comma-dangle": "error",
"babel/generator-star-spacing": "error",
//"babel/new-cap": "error",
"babel/no-await-in-loop": "error",
//"babel/object-curly-spacing": [ "error", "always" ],
"babel/object-shorthand": [ "error", "always" ],
// https://github.com/xjamundx/eslint-plugin-promise#rule
"promise/catch-or-return": "error",
//"promise/always-return": "error",
"promise/always-catch": "error",
"promise/no-native": "off",
// https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules
//"react/forbid-prop-types": "error",
"react/no-danger": "error",
"react/no-did-mount-set-state": "error",
"react/no-multi-comp": [ "error", { "ignoreStateless": true } ],
//"react/no-set-state": "error",
"react/no-string-refs": "error",
"react/prefer-es6-class": [ "error", "always" ],
//"react/prefer-stateless-function": "error",
"react/require-optimization": "error",
"react/sort-comp": "error",
//"react/sort-prop-types": "error",
// https://github.com/yannickcr/eslint-plugin-react#jsx-specific-rules
//"react/jsx-closing-bracket-location": [ "error", { "nonEmpty": "tag-aligned", "selfClosing": false } ],
"react/jsx-filename-extension": "error",
"react/jsx-first-prop-new-line": "off",
"react/jsx-handler-names": "off",
"react/jsx-key": "error",
"react/jsx-max-props-per-line": "off",
"react/jsx-no-comment-textnodes": "error",
"react/jsx-no-literals": "off",
"react/jsx-no-target-blank": "error",
"react/jsx-pascal-case": "error",
"react/jsx-sort-props": "off",
"react/jsx-indent": ["error", 4],
"react/jsx-indent-props": ["error", 4],
"react/jsx-no-bind": "off",
//"react/jsx-wrap-multilines": "error"
}
}