-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
62 lines (61 loc) · 1.92 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
const readonly = 'readonly';
const error = 'error';
const warn = 'warn';
const off = 'off';
module.exports = {
extends: [
'airbnb-base',
],
env: {
es6: true,
browser: true,
jquery: true,
greasemonkey: true,
node: false,
},
globals: {
BootstrapDialog: readonly,
SimpleToast: readonly,
},
parserOptions: {
sourceType: 'module',
},
rules: {
// Warn, we allow this behavior, but want to be aware of any possible issues
'consistent-return': warn,
// We allow modification of properties
'no-param-reassign': [warn, { props: false }],
// Allow short circuits: test && action
'no-unused-expressions': [error, { allowShortCircuit: true }],
// Allow function arguments to be unused
'no-unused-vars': [error, { args: 'none' }],
// Allow functions to be defined after references (functions are top-level)
'no-use-before-define': [error, 'nofunc'],
// Deconstruction not required when assigning to object properties (declared_var = object.key)
'prefer-destructuring': [error, {
AssignmentExpression: { array: true, object: false },
}],
// Allow for loops to use unary (++/--)
'no-plusplus': [error, { allowForLoopAfterthoughts: true }],
'prefer-arrow-callback': [error, { allowNamedFunctions: true } ],
'no-useless-return': warn,
'class-methods-use-this': off,
'no-restricted-globals': [error, ''],
'no-bitwise': off,
'no-mixed-operators': off,
'no-continue': off,
'object-curly-newline': [error, { multiline: true, consistent: true }],
'operator-linebreak': [error, 'after'],
'quotes': [error, 'single', { allowTemplateLiterals: true, }],
'max-len': [error, {
code: 120,
ignoreComments: true,
ignoreRegExpLiterals: true,
ignoreStrings: true,
tabWidth: 2,
}],
'no-extra-boolean-cast': warn,
'no-underscore-dangle': warn,
'import/no-mutable-exports': warn,
},
};