forked from Vizzuality/care-international
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
186 lines (135 loc) · 4.99 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
{
"env": {
"browser": true,
"node": true
},
"parser": "babel-eslint",
"plugins": [
"react"
],
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"globals": {
"google": false
},
"rules": {
// For a complete reference, check out http://eslint.org/docs/rules/
//-------------------------------------------------------------------------
// Best practices
//-------------------------------------------------------------------------
// Prevent abbreviated blocks for clarity
"curly": [2, "multi-line"],
// Enforce a reasonable cap on functions spiralling out of control
// with many branches.
"complexity": [2, 10],
// Prefer foo.x over foo['x']; static properties are always preferable
// to dynamic strings.
"dot-notation": 0,
"dot-location": [2, "property"],
// enforce === and !== for comparisons
"eqeqeq": [2, "smart"],
"guard-for-in": 2,
"no-floating-decimal": 2,
// Avoid funny things with parseInt.
// See: http://stackoverflow.com/questions/850341
"radix": 2,
// Avoid pitfalls when trying to call a just-declared function.
"wrap-iife": 2,
// May the force be with you.
"yoda": [0, "always"],
// Helpful smattering
"no-redeclare": 2,
"no-return-assign": 2,
// Semicolons
"semi": 1,
//-------------------------------------------------------------------------
// Errors
//-------------------------------------------------------------------------
"constructor-super": 2,
"no-cond-assign": [ 2, "except-parens" ],
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty": 2,
"no-func-assign": 2,
"no-undef": 2,
"no-unreachable": 2,
"block-scoped-var": 2,
"no-console": 1, // Warn so we don't commit console.logs
"no-debugger": 1,
"no-alert": 2,
//-------------------------------------------------------------------------
// Strict Mode
//-------------------------------------------------------------------------
// Transpilers deal with the effects of strict, so ignore it.
"strict": [2, "never"],
//-------------------------------------------------------------------------
// Variable declaration
//-------------------------------------------------------------------------
"no-use-before-define": 2,
"no-undefined": 0,
"no-unused-vars": 2,
//-------------------------------------------------------------------------
// Code style
//-------------------------------------------------------------------------
// The one true brace style.
"brace-style": [2, "1tbs"],
"camelcase": 0,
"comma-spacing": [2, { "before": false, "after": true }],
"consistent-this": [2, "_this"],
"eol-last": 2,
"indent": [2, 2, { "SwitchCase": 1 }],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
"new-cap": [2, { "capIsNewExceptionPattern" : "^Immutable\\.." }],
"no-lonely-if": 2,
"no-mixed-spaces-and-tabs": [2, true],
"no-multiple-empty-lines": 2,
// Nested ternaries are just plain confusing. Avoiding them keeps the
// code readable.
"no-nested-ternary": 2,
// There are no such thing as "private" properties. Use closure
// variables if you really need isolation.
"no-underscore-dangle": 0,
"no-spaced-func": 2,
// use one variable declaration for each variable you want to define
"one-var": [2, "never"],
// enforce double quotes
"quotes": [2, "double"],
// Enforce whitespace for visual clarity.
"keyword-spacing": 2,
"spaced-comment": [2, "always", { "exceptions": ["-"] }],
//-------------------------------------------------------------------------
// ECMAScript 6
//-------------------------------------------------------------------------
// Enforce `const` and `let` to describe what's going on.
"no-var": 2,
//-------------------------------------------------------------------------
// React
//-------------------------------------------------------------------------
"jsx-quotes": [2, "prefer-double"],
"react/jsx-uses-vars": 2,
"react/jsx-uses-react": 2,
// Display name is not needed when using ES6-style components
"react/display-name": 0,
// Make things consistent and readable – prefer `x` over `x={true}`
"react/jsx-boolean-value": 2,
// Keep the quote style consistent with Javascript land
"react/jsx-no-undef": 2,
"react/jsx-sort-props": 0,
"react/jsx-sort-prop-types": 0,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-multi-comp": 0,
"react/no-unknown-property": 2,
"react/react-in-jsx-scope": 0,
"react/self-closing-comp": 2,
"react/jsx-wrap-multilines": 2,
// Potential issue in React ESLint package- receiving 'Can't add property
// react, object is not extensible' when used with eslint-loader.
"react/prop-types": 0,
"comma-dangle": [1, "always-multiline"],
}
}