preferFromOffsetUse UDim2.fromOffset() instead of new UDim2() when all scales are 0.UDim2 Shorthandsmall-rules/prefer-udim2-shorthandPrefer UDim2.fromScale() or UDim2.fromOffset() over new UDim2() when all offsets or all scales are zero.
When you write new UDim2(scaleX, 0, scaleY, 0) those zeros are dead weight. Same story for new UDim2(0, offsetX, 0, offsetY). You are ONLY using scale, or ONLY using offset, and the constructor makes you spell
out all four anyway.
UDim2.fromScale(scaleX, scaleY) and UDim2.fromOffset(offsetX, offsetY) say exactly what you meant
without the noise. Auto-fixes, so there is no excuse to keep the long form around.
preferFromOffsetUse UDim2.fromOffset() instead of new UDim2() when all scales are 0.preferFromScaleUse UDim2.fromScale() instead of new UDim2() when all offsets are 0.This rule does not accept options.
new UDim2(1, 0, 1, 0);After auto-fix
UDim2.fromScale(1, 1);new UDim2(1, 2, 3, 4);