Skip to content

Roblox & Luau Rules

Rules for Roblox instances, Ianitor, Color3, UDim2, and other Roblox APIs.Browse all 25 rules in this category.

Showing 25 rules

No Array Constructor Index Assignment

Roblox & Luau Rules
no-array-constructor-index-assignment

Disallow new Array<T>() followed by contiguous index assignments; use an array literal instead.

  • Suggestion
  • Automatic fix

Ban Instances

Roblox & Luau Rules
ban-instances

Ban specified Roblox Instance classes and configured Instance properties.

  • Problem

Enforce Ianitor Check Type

Roblox & Luau Rules
enforce-ianitor-check-type

Enforce Ianitor.Check<T> type annotations on complex TypeScript types

  • Problem

No Array Constructor Elements

Roblox & Luau Rules
no-array-constructor-elements

Disallow array constructor element forms and enforce roblox-ts-aware constructor patterns.

  • Problem
  • Automatic fix and editor suggestions

No Array Size Assignment

Roblox & Luau Rules
no-array-size-assignment

Disallow array append assignments using array[array.size()] = value (roblox-ts) or array[array.length] = value (standard) and prefer push-based appends.

  • Problem
  • Automatic fix

No Async In System

Roblox & Luau Rules
no-async-in-system

Disallow yielding Roblox API calls in synchronous Planck system execution.

  • Problem

No Color3 Constructor

Roblox & Luau Rules
no-color3-constructor

Ban new Color3(...) except new Color3() or new Color3(0, 0, 0). Use Color3.fromRGB() instead.

  • Problem
  • Automatic fix

No Events In Events Callback

Roblox & Luau Rules
no-events-in-events-callback

Disallow sending Events back to the same player inside an Events.connect callback; use Functions for request/response.

  • Problem

No Ianitor In Function Body

Roblox & Luau Rules
no-ianitor-in-function-body

Disallow Ianitor validator creation inside function bodies. Hoist to module scope to avoid recreating validators on every call.

  • Problem

No Ianitor Success Access

Roblox & Luau Rules
no-ianitor-success-access

Disallow accessing `.success` on Ianitor check results when the full result object is not needed.

  • Suggestion

No Instance Methods Without This

Roblox & Luau Rules
no-instance-methods-without-this

Detect instance methods that do not use 'this' and suggest converting them to standalone functions for better performance in roblox-ts.

  • Problem

No Native Properties Spread

Roblox & Luau Rules
no-native-properties-spread

Disallow spreading static property bags into nativeProperties/*NativeProperties props and onto JSX elements via intermediate objects, because the spread creates a new copied table every render.

  • Problem

No Print

Roblox & Luau Rules
no-print

Use Log instead of print().

  • Problem

No Redundant Aspect Ratio Constraint

Roblox & Luau Rules
no-redundant-aspect-ratio-constraint

Disallow redundant uiaspectratioconstraint children inside components that already manage their own aspect ratio internally.

  • Problem

No Table Create Map

Roblox & Luau Rules
no-table-create-map

Disallow map(...) directly on table.create(...) and new Array(...) constructor patterns in roblox-ts.

  • Suggestion

No Task Wait

Roblox & Luau Rules
no-task-wait

Disallow task.wait() and Promise.delay(...).await() calls.

  • Problem

No Useless Default

Roblox & Luau Rules
no-useless-default

Disallow Roblox JSX properties whose values already match the class defaults.

  • Suggestion
  • Automatic fix

No Warn

Roblox & Luau Rules
no-warn

Use Log instead of warn().

  • Problem

Prefer Idiv

Roblox & Luau Rules
prefer-idiv

Prefer .idiv() for integer division instead of math.floor(x / y).

  • Suggestion
  • Automatic fix

Prefer Math Min Max

Roblox & Luau Rules
prefer-math-min-max

Prefer math.min() and math.max() over simple clamp-like ternaries.

  • Suggestion
  • Automatic fix

Prefer Modding Inspect

Roblox & Luau Rules
prefer-modding-inspect

Prefer Modding.inspect over manually enumerating every enum member in a Record<Enum, true>.

  • Suggestion
  • Automatic fix

Prefer Sequence Overloads

Roblox & Luau Rules
prefer-sequence-overloads

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

  • Suggestion
  • Automatic fix

Prefer Single World Query

Roblox & Luau Rules
prefer-single-world-query

Enforce combining multiple world.get() or world.has() calls into a single call for better Jecs performance.

  • Suggestion
  • Automatic fix

Prefer Udim2 Shorthand

Roblox & Luau Rules
prefer-udim2-shorthand

Prefer UDim2.fromScale() or UDim2.fromOffset() over new UDim2() when all offsets or all scales are zero.

  • Suggestion
  • Automatic fix

Require Module Level Instantiation

Roblox & Luau Rules
require-module-level-instantiation

Require configured classes to be instantiated at module level only.

  • Problem