GX linter
Contract
bus gx lint validates .gx source without writing files. It rejects
malformed GX, raw text content, duplicate declarations in the same file,
unsafe lowercase attributes, inline JavaScript handlers, invalid tag casing,
and unsupported syntax.
bus gx lint --format json emits machine-readable diagnostics for agent
workflows. Valid source returns an empty diagnostics array. Source diagnostics
that block use in CI make the command exit non-zero.
Usage:
bus gx lint [--format text|json] <file.gx>...
The command accepts one or more explicit .gx file paths. It does not read
stdin and does not expand directories. Shell globs are handled by the shell
before bus gx starts; after expansion, every operand must be a readable file.
The linter does not render, compile generated Go, load data, evaluate runtime values, run controller code, or validate browser behavior.
Module-local tests may call ./bin/bus-gx gx lint after make build, but
user-facing commands go through the bus dispatcher.
Example
bus gx lint --format json hello.gx
The same source coordinate rules are used by human output and JSON output, so agents can apply fixes without guessing at byte ranges.