@putout/plugin-convert-imul-to-multiplication
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
Math.imul()
to *
operator.
Check out in @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