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
'prefer-spread' : 'off' ,
8
8
// Not supported in ES3
9
9
'comma-dangle' : [ 'error' , 'never' ]
10
10
} ;
11
11
12
- const CUSTOM_RULES = {
12
+ var CUSTOM_RULES = {
13
13
'one-var' : 'off' ,
14
14
// We control our own objects and prototypes, so no need for this check
15
15
'guard-for-in' : 'off' ,
@@ -18,7 +18,7 @@ const CUSTOM_RULES = {
18
18
'indent' : [ 'error' , 2 , { 'SwitchCase' : 1 } ] ,
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' , { code : 120 , tabWidth : 2 , ignoreUrls : true } ] ,
21
- // Google overrides the default ESLint behaviour here, which is slightly better for catching erroneously unused variables
21
+ // Go back to default ESLint behaviour here, which is slightly better for catching erroneously unused variables
22
22
'no-unused-vars' : [ 'error' , { vars : 'all' , args : 'after-used' } ] ,
23
23
'require-jsdoc' : 'off' ,
24
24
'valid-jsdoc' : 'off'
@@ -27,11 +27,11 @@ const CUSTOM_RULES = {
27
27
module . exports = {
28
28
extends : 'google' ,
29
29
parserOptions : {
30
- ecmaVersion : 3
30
+ ecmaVersion : 5
31
31
} ,
32
32
rules : Object . assign (
33
33
{ } ,
34
34
DISABLED_ES6_OPTIONS ,
35
35
CUSTOM_RULES
36
- ) ,
36
+ )
37
37
} ;
0 commit comments