Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use no-param-reassign's ignorePropertyModificationsFor option #1325

Merged
merged 1 commit into from Mar 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 14 additions & 2 deletions packages/eslint-config-airbnb-base/rules/best-practices.js
Expand Up @@ -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',
Expand Down