🔧 This rule is automatically fixable by the --fix CLI option.
💭 This rule requires type information.
This rule automatically replaces .length and .size property accesses on arrays, strings, Set, Map, WeakSet, and WeakMap with a .size() method call. This is necessary for Roblox compatibility, as these properties do not exist in roblox-ts.
const n = arr.length; // ❌
const n = arr.size(); // ✅
const n = str.length; // ❌
const n = str.size(); // ✅
const n = set.size; // ❌
const n = set.size(); // ✅
const n = map.size; // ❌
const n = map.size(); // ✅
const n = weakSet.size; // ❌
const n = weakSet.size(); // ✅
const n = weakMap.size; // ❌
const n = weakMap.size(); // ✅