close

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

Hello Guys, How are you all? Hope You all Are Fine. Today we are going to learn How to avoid no-param-reassign when setting a property on a DOM object in javascript. So Here I am Explain to you all the possible methods here.

Without wasting your time, Let’s start This Article.

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

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

    to avoid no-param-reassign when setting a property on a DOM object 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.

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

    to avoid no-param-reassign when setting a property on a DOM object 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.

Method 1

You can override this rule inside your .eslintrc file and disable it for param properties like this

{
    "rules": {
        "no-param-reassign": [2, { 
            "props": false
        }]
    },
    "extends": "eslint-config-airbnb"
}

Method 2

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.

Summery

It’s all About this article. Hope all method helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which method worked for you? Thank You.

Leave a Comment