1.0.1 β€’ Published 2 years ago

@putout/plugin-convert-imul-to-multiplication v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@putout/plugin-convert-imul-to-multiplication NPM version

Multiplying two numbers stored internally as integers (which is only possible with AsmJS with imul is the only potential circumstance where Math.imul() may prove performant in current browsers.

(c) MDN

🐊Putout plugin adds ability to convert Math.imul() to * operator. Check out in 🐊Putout Editor. Merged to @putout/plugin-math.

Install

npm i @putout/plugin-convert-imul-to-multiplication -D

Rule

Rule convert-imul-to-multiplication is enabled by default, to disable add to .putout.json:

{
    "rules": {
        "convert-imul-to-multiplication": "off"
    }
}

❌ Example of incorrect code

const a = Math.imul(b, c);

βœ… Example of correct code

const a = b * c;

License

MIT