File tree Expand file tree Collapse file tree
packages/eslint-config-airbnb-base/rules Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,9 +164,21 @@ module.exports = {
164164 'no-octal-escape' : 'error' ,
165165
166166 // disallow reassignment of function parameters
167- // disallow parameter object manipulation
167+ // disallow parameter object manipulation except for specific exclusions
168168 // rule: http://eslint.org/docs/rules/no-param-reassign.html
169- 'no-param-reassign' : [ 'error' , { props : true } ] ,
169+ 'no-param-reassign' : [ 'error' , {
170+ props : true ,
171+ ignorePropertyModificationsFor : [
172+ 'acc' , // for reduce accumulators
173+ 'e' , // for e.returnvalue
174+ 'ctx' , // for Koa routing
175+ 'req' , // for Express requests
176+ 'request' , // for Express requests
177+ 'res' , // for Express responses
178+ 'response' , // for Express responses
179+ '$scope' , // for Angular 1 scopes
180+ ]
181+ } ] ,
170182
171183 // disallow usage of __proto__ property
172184 'no-proto' : 'error' ,
You can’t perform that action at this time.
0 commit comments