ftl-lint
ftl-lint checks Fluent FTL resources for syntax and structural problems. It uses the repository’s error-tolerant Tree-sitter grammar and reports source labels, Fluent error codes, notes, and actionable help.
Build and run
Build the linter with Nix:
nix build .#ftl-lint
./result/bin/ftl-lint path/to/messages.ftl
Run it without creating a result link:
nix run .#ftl-lint -- path/to/messages.ftl
Build it directly with Cargo from this checkout:
cargo build --release -p fluent-lint --bin ftl-lint
./target/release/ftl-lint path/to/messages.ftl
Inputs
Pass one or more files as separate arguments:
ftl-lint locales/en/messages.ftl locales/pl/messages.ftl
Use - once to read an FTL resource from standard input:
ftl-lint - < locales/en/messages.ftl
Output
Human-readable diagnostics are the default and go to standard error. Color is enabled when standard error is a terminal, unless NO_COLOR is set. Override the choice with --color always, --color never, or --no-color.
Use --format json for editor and tool integration. JSON diagnostics go to standard output, while invocation and I/O errors remain on standard error. The JSON diagnostics protocol defines the stable integration interface.
Options
| Option | Meaning |
|---|---|
|
Select |
|
Select |
|
Alias for |
|
Print command help |
|
Print the version |
Exit status
| Status | Meaning |
|---|---|
|
Every input is clean |
|
At least one diagnostic was reported |
|
Invocation or I/O failure |
An I/O failure takes precedence over diagnostics from other inputs, so a multi-file run returns status 2 if any file cannot be read.
Diagnostic codes
The linter emits these Project Fluent syntax codes where applicable:
| Code | Meaning |
|---|---|
|
Invalid entry or syntax |
|
Expected token |
|
Message requires a value or attributes |
|
Term requires a value |
|
Missing default variant |
|
Missing attribute value |
|
Duplicate default variant |
|
Term attribute used as a placeable |
|
Unterminated string |
|
Unbalanced closing brace |
W1001 is a project lint that replaces redundant PLURAL(…) wrappers with native Fluent selection.