I have a method which\'s main purpose is to set a property on a DOM object
function (el) {
el.expando = {};
}
I use AirBnB\'s code style
As @Mathletics suggests, you can disable the rule entirely by adding this to your .eslintrc.json file:
"rules": {
"no-param-reassign": 0
}
Or you could disable the rule specifically for param properties
"rules": {
"no-param-reassign": [2, { "props": false }]
}
Alternatively, you could disable the rule for that function
/* eslint-disable no-param-reassign */
function (el) {
el.expando = {};
}
/* eslint-enable no-param-reassign */
Or for that line only
function (el) {
el.expando = {}; // eslint-disable-line no-param-reassign
}
You might also check out this blog post on disabling ESLint rules specifically to accommodate AirBnB's style guide.