Socket
Socket
Sign inDemoInstall

@putout/plugin-remove-useless-operand

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @putout/plugin-remove-useless-operand

🐊Putout plugin adds ability to remove useless operand


Version published
Weekly downloads
5K
increased by3%
Maintainers
1
Install size
4.62 kB
Created
Weekly downloads
 

Readme

Source

@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

Keywords

FAQs

Last updated on 11 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc