-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
60 lines (54 loc) · 1.43 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
/* globals process */
// production rules
const prod = {
'no-magic-numbers': ['warn', { 'ignore': [0, 1, -1]}],
'no-console': ['error', {'allow': ['warn', 'error']}],
'strict': ['error', 'function'],
// // stylistic issues
'indent': ['error', 4],
// es6 these are required in airbnb-base, but don't work in IE 11
'no-var': 0,
'object-shorthand': ['error', 'never'],
'prefer-rest-params': 0,
'prefer-arrow-callback': 0,
'prefer-template': 0,
'no-await-in-loop': 0,
'no-return-await': 0,
// trailing comma in functions not supported in ES5
'comma-dangle': ['error', {'arrays': 'always-multiline', 'objects': 'always-multiline', 'functions': 'never'}],
};
// dev rules extend production rules
const dev = Object.assign(
{},
prod,
{
'no-console': 0,
}
);
// decide which rules to use -- default to dev
let rules = dev;
if(process.env.NODE_ENV === 'production') {
rules = prod;
}
module.exports = {
'extends': 'airbnb-base',
'parserOptions': {
'sourceType': 'script', // airbnb-base sets this to module
},
'env': {
'browser': true,
'es6': true,
},
'globals': {
'JSINFO': false,
'LANG': false,
'jQuery': false,
'createPicker': false,
'DOKU_BASE': false,
'pickercounter': true,
'pickerToggle': false,
'pickerInsert': false,
'QUnit': false
},
rules
};