@putout/plugin-convert-imul-to-multiplication
v1.0.1
Published
šPutout plugin adds ability to convert 'Math.imul()' to operator '*'
Downloads
1,913
Maintainers
Readme
@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
š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