useIdivUse .idiv() instead of math.floor(x / y) or math.floor(x * 0.5) for integer division.idivsmall-rules/prefer-idivPrefer .idiv() for integer division instead of math.floor(x / y) or math.floor(x * 0.5).
roblox-ts has a dedicated integer division operator, x.idiv(y), that does exactly what math.floor(x / y)
does but compiles to x // y instead of a floor plus a division. Should be a bit faster, and it’s clearer
about what you meant.
Auto-fixes math.floor(x / y) to x.idiv(y). Only fires when the divisor is a division expression, so it
won’t touch anything weird.
useIdivUse .idiv() instead of math.floor(x / y) or math.floor(x * 0.5) for integer division.This rule does not accept options.
math.floor(x / y);After auto-fix
x.idiv(y);x.idiv(y);