@putout/plugin-convert-assignment-to-comparison
🐊Putout plugin adds ability convert assignment to comparison
Last updated 2 years 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.

Merged to @putout/plugin-assignment.

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.1                                ...           latest (2 years ago)

3 Versions

  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (7)
Dependents (1)

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