Skip to content

Files

Latest commit

09ae161 · Apr 13, 2024

History

History
This branch is 2586 commits behind coderaiser/putout:master.

plugin-remove-useless-assign

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 19, 2023
Jun 19, 2023
Jul 20, 2022
May 18, 2022
Jun 19, 2023
Apr 10, 2024
Apr 13, 2024
Jun 19, 2023
May 18, 2022
May 18, 2022
Apr 8, 2024

@putout/plugin-remove-useless-assign NPM version

The Object.assign() method copies all enumerable own properties from one or more source objects to a target object. It returns the modified target object.

(c) MDN

🐊Putout plugin adds ability to remove useless assign. Check it out in 🐊Putout Editor.

Install

npm i @putout/plugin-remove-useless-assign

Rule

{
    "rules": {
        "remove-useless-assign": "on"
    }
}

❌ Example of incorrect code

const load = stub().rejects(assign(Error('LOAD USED')));

✅ Example of correct code

const load = stub().rejects(Error('LOAD USED'));

License

MIT