forked from fotherga/StringToDate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
194 lines (193 loc) · 5.27 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
187
188
189
190
191
192
193
194
{
//"extends": "eslint:all",
"rules": {
"lines-around-comment": "off",
// don't waste space with to many empty lines.
"no-inline-comments": "off",
// why not!
"func-names": "off",
// each object property does not have a function name, though its recommended with other functions.
"object-property-newline": "off",
// uses object-curly-newline, max 2 inline.
"no-underscore-dangle": "off",
// dangling for private variables
"no-invalid-this": "off",
// should be checked, however using dojoLang.hitch, there will be many
"vars-on-top": "off",
// Functions fill have a logger first, best practice to have all var declared just after
"no-negated-condition": "off",
// create un needed if states.
"newline-before-return": "off",
// styling we might like to use?
"callback-return": "off",
// maybe should be enabled.
"sort-vars": "off",
// not easy, when assigning derived value in de var declaration.
"newline-after-var": "off",
// could be a good option...
"no-extra-parens": "off",
//make code more readable.
"no-ternary": "off",
// usefull for shorting code.
// FOB Preference.
"init-declarations": [
"error",
"always"
],
// always init your declarations, set it to null if you like so.
"valid-jsdoc": [
"error",
{
"requireReturn": false
}
],
// we do not need to document return in js-doc
"id-length": [
"error",
{
"exceptions": [
"x",
"y",
"i",
"j"
]
}
],
// we except the use for short vars i and j for iterators, x and y for coordinates.
"dot-location": [
"error",
"property"
],
// like to see the dot in front of the new line.
"multiline-ternary": "off",
"padded-blocks": [
"error",
"never"
],
//"linebreak-style": ["error", "windows"], // we should choose, as the cloud is unix...
"consistent-return": "error",
//
"indent": [
"error",
4
],
"no-else-return": "error",
"semi": [
"error",
"always"
],
"space-unary-ops": "error",
"max-statements": [
"error",
25
],
// could be a little but more complex that the default 16
"max-depth": [
"error",
5
],
// still need to defile best level
"complexity": [
"error",
7
],
"max-len": [
"warn",
{
"code": 120,
"ignoreComments": true
}
],
//"max-params": ["warn", 3],
"max-params": "off",
"max-nested-callbacks": [
"error",
1
],
"no-trailing-spaces": "error",
"quotes": [
"error",
"double",
{
"avoidEscape": true
}
],
"camelcase": "error",
// camel
//"vars-on-top" : "error",
"no-magic-numbers": [
"error",
{
"ignore": [
-1,
0,
1
]
}
],
// dont use magic number, please name your numbers
"spaced-comment": [
"error",
"always",
{
"exceptions": [
"-",
"+"
]
}
],
// spaced comments better readable.
"quote-props": [
"error",
"as-needed"
],
// dont use more quotes than needed.
//"object-curly-newline" : ["error", {"minProperties": 3 }],
"object-curly-newline": [
"error",
{
"multiline": true,
"minProperties": 3
}
],
// properties inline is ok, but not more than 3
"max-lines": [
"error",
{
"max": 400,
"skipBlankLines": true,
"skipComments": true
}
],
"object-curly-spacing": [
"error",
"never"
],
// disables es6 rules
"prefer-rest-params": "off",
// rest parameters are not widely supported
"no-dupe-class-members": "off",
"no-var": "off",
"object-shorthand": "off",
"prefer-arrow-callback": "off",
"prefer-spread": "off",
"prefer-template": "off",
"consistent-this": [
"error",
"that"
],
// stick to one version of this, that, self, me
"no-extra-bind": "error"
// limit the usage of .bind()
},
"env": {
"browser": true,
"amd": true
},
"globals": {
"logger": true,
"mendix": true,
"mxui": true,
"mx": true
}
}