-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
190 lines (146 loc) · 4.48 KB
/
index.js
File metadata and controls
190 lines (146 loc) · 4.48 KB
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
module.exports = {
extends: 'airbnb-base',
plugins: [
'import',
],
env: {
es6: true,
browser: true,
node: true,
jquery: true,
},
globals: {
main: true,
$: true,
jQuery: true,
},
parserOptions: {
ecmaVersion: 8,
},
rules: {
// Requires braces around arrow functions
// Doesn't work with promise chain return functions
'arrow-body-style': [
'error',
'as-needed',
],
// should only have parens if arrow function has more than 1 arg
'arrow-parens': [
'warn',
'as-needed',
],
// Expects commas after functions
'comma-dangle': [
'warn',
{
arrays: 'always',
objects: 'always',
imports: 'never',
exports: 'never',
functions: 'ignore',
},
],
// functions do not always need a return
'consistent-return': 0,
// functions can be anonymous
'func-names': 0,
// require() does not need to be at the top of the page
'global-require': 0,
// for in loops do not need to be wrapped in an if statement to protect from type
'guard-for-in': 0,
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': [
2,
{
ignore: [
'bootstrap$',
],
},
],
// override airbnb and make sure spaces are 4 spaces instead of tabs
indent: [
'error',
4,
{
SwitchCase: 1,
},
],
// prevent LF vs CRLF errors
'linebreak-style': 0,
// do not worry about a line length, default max length is 100
'max-len': 0,
// allow ~~
'no-bitwise': 0,
// console is allowed
'no-console': 0,
// allow the use of 'continue' within loops
'no-continue': 0,
// allow !!
'no-extra-boolean-cast': 0,
// allow 'for' loop and switch statement labels
'no-labels': 0,
// allow consecutive operators without parentheses
'no-mixed-operators': 0,
// allow multiple lines greater than 2
'no-multiple-empty-lines': [
'warn',
{
max: 2,
maxEOF: 1,
},
],
// do not reassign function param variables, properties of the variable are alright
'no-param-reassign': 0,
// allow i++ and i--
'no-plusplus': 0,
// able to do this 'foo.hasOwnProperty('bar')' vs only this 'Object.prototype.hasOwnProperty.call(foo, 'bar')'
'no-prototype-builtins': 0,
// we should be able to use all properties. this allows the use of Math.pow
'no-restricted-properties': 0,
// do not prevent any JavaScript syntax, 'class, try-catch...'
'no-restricted-syntax': 0,
// child functions can have variables named the same as the parent
'no-shadow': 0,
// Doesn't allow underscore prefixed properties on objects
'no-underscore-dangle': 0,
// no unused vars, except for function arguments
'no-unused-vars': [
'warn',
{
args: 'none',
},
],
// functions are allowed to be hoisted
'no-use-before-define': 0,
// regex escape, might need to support older regex?
'no-useless-escape': 0,
// expects arrow functions for object functions
'object-shorthand': 0,
// do not worry about the spacing within the block
'padded-blocks': [
'error',
{
switches: 'never',
},
],
// arrow functions are not necessary
'prefer-arrow-callback': 0,
// when using let instead of const and no reassignment, only give a warning, no error
'prefer-const': [
'warn',
],
// prefer using `hello, ${name}` vs 'hello, ' + name
'prefer-template': 0,
// parse functions don't require a radix, defaults to 10
radix: [
'error',
'as-needed',
],
// we need to have 'use strict' right now until we get our new webserver setup
strict: [
0,
'global',
],
},
};
// TESTING 7