@putout/plugin-convert-assignment-to-comparison
🐊Putout plugin adds ability convert assignment to comparison
Last updated a year ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-convert-assignment-to-comparison 
SYNC missed versions from official npm registry.

@putout/plugin-convert-assignment-to-comparison NPM version

You should almost never have an if...else with an assignment like a = b as a condition.

(c) MDN

🐊Putout plugin adds ability to convert assignment to comparison.

Install

npm i @putout/plugin-convert-assignment-to-comparison -D

Rule

{
    "rules": {
        "convert-assignment-to-comparison": "on"
    }
}

❌ Example of incorrect code

if (a = b) {}

✅ Example of correct code

if (a === b) {}

License

MIT

Current Tags

  • 2.0.0                                ...           latest (a year ago)

2 Versions

  • 2.0.0                                ...           a year 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