How to avoid no-param-reassign when setting a property on a DOM object

前端 未结 11 730
无人共我
无人共我 2020-12-23 15:41

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

11条回答
  •  既然无缘
    2020-12-23 16:26

    Those wishing to selectively deactivate this rule might be interested in a proposed new option for the no-param-reassign rule that would allow a "white list" of object names with respect to which parameter reassignment should be ignored.

提交回复
热议问题