Lints

Luwu expands Luau's built-in lint system with more than 40 new lints for Luau and Luwu code. They help you write more idiomatic and performant code and catch mistakes the type checker can't see.

Lint control

Most lints are on by default. Turn one off for a file with --!nolint Name, or for one statement with @[nolint(Name)] above it. Turn on a lint that's off by default with --!lint Name:

--!lint ConstLocal

local total = 0
for _, price in { 4, 8, 15 } do
    total += price
end
print(total)

ConstLocal flags any local that's never reassigned and could be const. Because total is reassigned here, nothing is reported.

Optimization hints

OptimizationHint is the parent of every hint below: code the compiler could optimize better if it were written differently. Turning it off turns them all off.

Loops

Values

Expressive control flow

Names

Idiomatic Luwu

Style

Style is the group of layout lints. Turning it off turns all of them off, including ConstLocal, SameLineStatement and MultiLineStatement.