diff --git a/packages/eslint-config-airbnb-base/rules/best-practices.js b/packages/eslint-config-airbnb-base/rules/best-practices.js index 2587bc55..a3a9e1ea 100644 --- a/packages/eslint-config-airbnb-base/rules/best-practices.js +++ b/packages/eslint-config-airbnb-base/rules/best-practices.js @@ -164,9 +164,21 @@ module.exports = { 'no-octal-escape': 'error', // disallow reassignment of function parameters - // disallow parameter object manipulation + // disallow parameter object manipulation except for specific exclusions // rule: http://eslint.org/docs/rules/no-param-reassign.html - 'no-param-reassign': ['error', { props: true }], + 'no-param-reassign': ['error', { + props: true, + ignorePropertyModificationsFor: [ + 'acc', // for reduce accumulators + 'e', // for e.returnvalue + 'ctx', // for Koa routing + 'req', // for Express requests + 'request', // for Express requests + 'res', // for Express responses + 'response', // for Express responses + '$scope', // for Angular 1 scopes + ] + }], // disallow usage of __proto__ property 'no-proto': 'error',