@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
$ cnpm 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 (a year ago)

3 Versions

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

Copyright 2013 - present © cnpmjs.org | Home |