@putout/plugin-remove-useless-operand
🐊Putout plugin adds ability to remove useless operand
Last updated 3 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-remove-useless-operand 
SYNC missed versions from official npm registry.

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

The increment operator (++) adds one to its operand and returns a value.

The addition assignment operator (+=) adds the value of the right operand to a variable and assigns the result to the variable.

(c) MDN

🐊Putout plugin adds ability to remove useless operand.

Install

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

Rule

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

❌ Example of incorrect code

a = a + b;
a = b + a;
b += 1;

✅ Example of correct code

a += b;
++b;

License

MIT

Current Tags

  • 2.1.0                                ...           latest (3 years ago)

5 Versions

  • 2.1.0                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE