1
1
// The ESLint ecmaVersion argument is inconsistently used. Some rules will ignore it entirely, so if the rule has
2
2
// been set, it will still error even if it's not applicable to that version number. Since Google sets these
3
3
// rules, we have to turn them off ourselves.
4
- const DISABLED_ES6_OPTIONS = {
4
+ var DISABLED_ES6_OPTIONS = {
5
5
'no-var' : 'off' ,
6
6
'prefer-rest-params' : 'off'
7
7
} ;
8
8
9
- const SHAREDB_RULES = {
9
+ var SHAREDB_RULES = {
10
10
// Comma dangle is not supported in ES3
11
11
'comma-dangle' : [ 'error' , 'never' ] ,
12
12
// We control our own objects and prototypes, so no need for this check
13
13
'guard-for-in' : 'off' ,
14
14
// Google prescribes different indents for different cases. Let's just use 2 spaces everywhere. Note that we have
15
15
// to override ESLint's default of 0 indents for this.
16
- ' indent' : [ 'error' , 2 , {
17
- ' SwitchCase' : 1
16
+ indent : [ 'error' , 2 , {
17
+ SwitchCase : 1
18
18
} ] ,
19
19
// Less aggressive line length than Google, which is especially useful when we have a lot of callbacks in our code
20
20
'max-len' : [ 'error' ,
21
21
{
22
22
code : 120 ,
23
23
tabWidth : 2 ,
24
- ignoreUrls : true ,
24
+ ignoreUrls : true
25
25
}
26
26
] ,
27
- // Google overrides the default ESLint behaviour here, which is slightly better for catching erroneously unused variables
27
+ // Google overrides the default ESLint behaviour here, which is slightly better for catching erroneously unused
28
+ // variables
28
29
'no-unused-vars' : [ 'error' , { vars : 'all' , args : 'after-used' } ] ,
29
30
// It's more readable to ensure we only have one statement per line
30
31
'max-statements-per-line' : [ 'error' , { max : 1 } ] ,
@@ -46,4 +47,7 @@ module.exports = {
46
47
DISABLED_ES6_OPTIONS ,
47
48
SHAREDB_RULES
48
49
) ,
50
+ ignorePatterns : [
51
+ '/docs/'
52
+ ]
49
53
} ;
0 commit comments