@putout/plugin-remove-useless-assign

1.1.0 • Public • Published

@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

Package Sidebar

Install

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

Weekly Downloads

4,093

Version

1.1.0

License

MIT

Unpacked Size

4.05 kB

Total Files

4

Last publish

Collaborators

  • coderaiser