Expand description
Formspec Linter — 8-pass static analysis and validation pipeline.
Pass 1 (E100): Document type detection Pass 1b (E101): JSON Schema validation against embedded schemas Pass 2 (E200/E201): Tree indexing, duplicate key/path detection Pass 3 (E300/E301/E302/W300): Reference validation — bind paths, shape targets, optionSets Pass 3b (E600/E601/E602): Extension resolution against registry documents Pass 4 (E400): FEL expression compilation Pass 5 (E500): Dependency cycle detection Pass 6 (W700-W711/E710): Theme — token validation, reference integrity, page semantics Pass 7 (E800-E807/W800-W804): Components — tree validation, type compatibility, bind resolution
§Documentation
- Human overview: crate
README.md(pass map, options, module layout). - API reference:
cargo doc -p formspec-lint --no-deps --open. - Markdown API export:
docs/rustdoc-md/API.md(see README; regenerate withnpm run docs:formspec-lint).
Modules§
- component_
matrix - Component/dataType compatibility matrix for the 12 built-in input components.
- dependencies
- Pass 5: Dependency analysis — builds a dependency graph from compiled expressions and detects cycles via DFS.
- expressions
- Pass 4: Expression compilation — parses all FEL expression slots in a definition,
producing
CompiledExpressionstructs for downstream dependency analysis (pass 5) and E400 diagnostics for parse errors. - extensions
- Pass 3b: Extension validation (E600/E601/E602).
- pass_
component - Pass 7: Component document semantic checks (E800-E807, W800-W804).
- pass_
theme - Pass 6: Theme document semantic checks (W700-W711, E710).
- references
- Pass 3: Reference validation — checks bind paths and shape targets resolve against the item tree.
- tree
- Pass 2: Tree indexing — flattens the item tree into a lookup index.
Structs§
- Lint
Diagnostic - A lint diagnostic.
- Lint
Options - Options for the lint pipeline.
- Lint
Result - Result of linting.
Enums§
- Lint
Mode - Controls which diagnostics are emitted.
- Lint
Severity - Severity of a lint diagnostic (sorting, validity, and JSON wire values).
Functions§
- lint
- Run the full lint pipeline on a Formspec document with default options.
- lint_
result_ to_ json_ value - Serialize a
LintResultfor host bindings. - lint_
with_ options - Run the full lint pipeline with explicit options.
- sort_
diagnostics - Sort diagnostics: pass ASC, severity (error > warning > info), path ASC.