11// The ESLint ecmaVersion argument is inconsistently used. Some rules will ignore it entirely, so if the rule has
22// been set, it will still error even if it's not applicable to that version number. Since Google sets these
33// rules, we have to turn them off ourselves.
4- const DISABLED_ES6_OPTIONS = {
4+ var DISABLED_ES6_OPTIONS = {
55 'no-var' : 'off' ,
66 'prefer-rest-params' : 'off'
77} ;
88
9- const SHAREDB_RULES = {
9+ var SHAREDB_RULES = {
1010 // Comma dangle is not supported in ES3
1111 'comma-dangle' : [ 'error' , 'never' ] ,
1212 // We control our own objects and prototypes, so no need for this check
1313 'guard-for-in' : 'off' ,
1414 // Google prescribes different indents for different cases. Let's just use 2 spaces everywhere. Note that we have
1515 // to override ESLint's default of 0 indents for this.
16- ' indent' : [ 'error' , 2 , {
17- ' SwitchCase' : 1
16+ indent : [ 'error' , 2 , {
17+ SwitchCase : 1
1818 } ] ,
1919 // Less aggressive line length than Google, which is especially useful when we have a lot of callbacks in our code
2020 'max-len' : [ 'error' ,
2121 {
2222 code : 120 ,
2323 tabWidth : 2 ,
24- ignoreUrls : true ,
24+ ignoreUrls : true
2525 }
2626 ] ,
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
2829 'no-unused-vars' : [ 'error' , { vars : 'all' , args : 'after-used' } ] ,
2930 // It's more readable to ensure we only have one statement per line
3031 'max-statements-per-line' : [ 'error' , { max : 1 } ] ,
@@ -46,4 +47,7 @@ module.exports = {
4647 DISABLED_ES6_OPTIONS ,
4748 SHAREDB_RULES
4849 ) ,
50+ ignorePatterns : [
51+ '/docs/'
52+ ]
4953} ;
0 commit comments