lloyAlloy on GitHub
alloy lint
Docs

alloy lint

Updated

Runs the lints over the project, or over one file, and nothing else; alloy flux runs them with the compile and the type check. A lint is advice: the code runs, and the lint names a habit that costs bugs. The lints are Flux's, in eight groups:

correctness code that is wrong, or cannot run suspicious code that is probably not what the author meant style a Luau habit with an Alloy form: `a and a.b` for `a?.b`, `typeof(x) == "T"` for `x is T` complexity a simple thing done in a hard way; the limits sit in `[flux]` perf code that runs slower than the plain form roblox a Roblox API that is deprecated or misused pedantic strict rules, on while `[lint] strict = true` naming the case of names, off until `[lint.rules] naming = "warn"`

A lint whose rewrite keeps the program the same carries it, and --fix applies those; in the editor each one is a quick fix, and source.fixAll applies every rewrite of the file.

alloy lint                 the project of the nearest alloy.toml
alloy lint src/game.aly    one file
alloy lint --fix           apply the rewrites that keep the program the same
alloy lint -W pedantic     a level for this run: -W warns, -A allows, -D denies
alloy lint --deny-warnings fail on any hit
alloy lint --list          every lint with its group and level, in the `[lint.rules]` form

The [lint] table of alloy.toml says where every lint starts, and [lint.rules] sets one. Both modes are on by default, and alloy init writes them:

alloy.tomlalloy.toml
[lint]
recommended = true    # the level each lint declares; false starts every lint at allow
strict = true         # the pedantic group, at warn

[lint.rules]
correctness = "deny"
concat_interpolation = "allow"
luau = "allow"
naming = "warn"
alx.static_conditional_child = "deny"

[lint.naming]
const = "SCREAMING_SNAKE_CASE"   # the case of each kind of name; `alloy doc naming-conventions`

A key is a lint name, a group name, an ingot's <ingot>/<lint>, or alx.<name> for a markup lint; a name beats its group. recommended = false leaves every lint at allow, so the rules table alone says what runs; strict and the table still work on top of it. luau is the group of the type checker's own lints, LocalUnused and the rest, which alloy flux reports.

The old form, deny, warn, and allow lists in [lint] and a [alx.lints] table, still reads for one release and warns with the key that replaces it.

alloy lint --list names every lint in the [lint.rules] form. alloy doc lints lists them; alloy doc <name> explains one, and alloy doc <group> lists a group. The language server shows the same lints as warnings, with the rewrite in the message.