Skip to content

Prefer Sequence Overloads

SuggestionAuto-fixableRoblox
small-rules/prefer-sequence-overloads

Prefer direct ColorSequence and NumberSequence overloads over identical direct arguments and two-keypoint arrays.

Diagnostic Messages

preferSingleOverload
Use the single-value sequence overload instead of two identical keypoints.
preferTwoPointOverload
Use the two-value sequence overload instead of constructing a two-keypoint array.

Configuration

This rule does not accept options.

{
"jsPlugins": [
"@pobammer-ts/small-rules"
],
"rules": {
"small-rules/prefer-sequence-overloads": "error"
}
}

Examples

redundant sequence overload
const gradient = new ColorSequence(new Color3(), new Color3());

After auto-fix

const gradient = new ColorSequence(new Color3());
single-point ColorSequence overload
new ColorSequence(Color3.fromRGB(100, 200, 255));