# @putout/plugin-remove-useless-assign

> 🐊Putout plugin adds ability to remove useless assign

Latest version **2.0.0** (published 2025-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @putout/plugin-remove-useless-assign
pnpm add @putout/plugin-remove-useless-assign
yarn add @putout/plugin-remove-useless-assign
bun add @putout/plugin-remove-useless-assign
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2025-05-16 |
| First published | 2022-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 801 |
| Author | coderaiser |
| Maintainers | coderaiser |
| Keywords | putout, putout-plugin, plugin, assign, useless |

## Links

- npm: https://www.npmjs.com/package/@putout/plugin-remove-useless-assign
- Repository: https://github.com/coderaiser/putout
- Homepage: https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-assign#readme
- Issues: https://github.com/coderaiser/putout/issues
- npm.io page: https://npm.io/package/@putout/plugin-remove-useless-assign

## Recent versions

- 2.0.0 (latest) — 2025-05-16
- 1.1.0 — 2022-05-29
- 1.0.0 — 2022-05-18

## README

# @putout/plugin-remove-useless-assign [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-useless-assign.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-remove-useless-assign "npm"

> 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](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to remove useless `assign`.
Check it out in 🐊[Putout Editor](https://putout.cloudcmd.io/#/gist/04c18d7d2302e0a3cc543c7c83adeaf2/ddb38d94dcc6425fc944e3b130837739f916c7df).

## Install

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

## Rule

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

## ❌ Example of incorrect code

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

## ✅ Example of correct code

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

## License

MIT

---
_Source: https://npm.io/package/@putout/plugin-remove-useless-assign · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
