preferArrayLiteralUse an array literal instead of new Array<T>() followed by index assignments.small-rules/no-array-constructor-index-assignmentDisallow new Array<T>() followed by contiguous index assignments; use an array literal instead.
new Array<T>() then immediately writing arr[0] = a; arr[1] = b; right after is just a slow, ugly way to
write [a, b]. And on roblox-ts specifically, you’re doing something that Luau does not like: unnecessary indexing.
This catches the pattern where you declare an empty array and fill it in by index right after. Auto-fixes to a literal when the assignments are contiguous and don’t reference the array itself. If you’re actually building a sparse array with gaps, this rule stays out of your way.
preferArrayLiteralUse an array literal instead of new Array<T>() followed by index assignments.This rule does not accept options.
const samples = new Array<string>();samples[0] = replacement;After auto-fix
const samples = [replacement];const samples = [replacement];