Appearance
Lint rules
Every rule the linter ships, with a page each. A page says what the rule checks and shows an example message and an example form in FSH, with the lines the rule reports highlighted. sdc-lint explain <rule-id> prints the full documentation: why the rule matters, how to fix what it reports and what it cannot see.
Each example is one of the rule's lint cases: a minimal form in YAML, compiled by SUSHI. Testing rules with lint cases explains how they are written and checked.
Core rules
The sdc rules check the expressions of a Questionnaire against the SDC specification and the FHIRPath engine. They run by default, at the severity shown, which a config can change (Configuration). lint/stale-suppression checks the suppressions in the config.
| Rule | Default | Reports |
|---|---|---|
sdc/dependency-cycle | warning | Reports declarations whose expressions reference each other in a cycle. |
sdc/duplicate-declaration | error | Reports a name declared more than once on one item or on the root. |
sdc/external-expression | info | Reports an expression whose content is only behind a reference. |
sdc/fragment-parse-error | error | Reports a FHIRPath expression embedded in an x-fhir-query that does not parse. |
sdc/language-not-allowed | error | Reports an expression language that SDC does not allow at its location. |
sdc/language-not-in-value-set | warning | Reports an expression language that FHIR R4 and R5 do not define. |
sdc/parse-error | error | Reports a FHIRPath expression that does not parse. |
sdc/query-syntax | error | Reports an x-fhir-query that is not a FHIR search. |
sdc/reserved-name | error | Reports a declaration of a name that FHIRPath, FHIR or SDC defines. |
sdc/shadowed-declaration | info | Reports a name an item declares that an ancestor item or the root also declares. |
sdc/uncatalogued-expression | info | Reports an expression in a place the linter does not recognise. |
sdc/undefined-variable | error | Reports a %name that is not available where it is used. |
sdc/unknown-function | error | Reports a call to a function that fhirpath.js does not implement. |
sdc/unresolved-linkid | warning | Reports a literal linkId that no item in the Questionnaire has. |
sdc/unused-declaration | warning | Reports a variable that no expression references. |
lint/stale-suppression | warning | Reports a suppression that is no longer needed. |
Smart Forms rules
The smart-forms rules report where Smart Forms behaves differently from SDC, in the versions selected in compat. They run only when the plugin is listed in an .mjs config (The Smart Forms plugin).
| Rule | Default | Reports |
|---|---|---|
smart-forms/unsupported-expression-language | error | Reports an expression Smart Forms ignores because of its language. |
smart-forms/expression-evaluated-as-fhirpath | error | Reports an expression Smart Forms evaluates as FHIRPath whatever its language. |
smart-forms/questionnaire-variable-unavailable | error | Reports a reference to %questionnaire or %qitem, which Smart Forms does not supply. |
smart-forms/unsupported-query-embedding | error | Reports a {{…}} embedding in an x-fhir-query that Smart Forms population does not fill as written. |
smart-forms/variable-name-collision | error | Reports a name declared on two elements, or named like a sourceQueries result, which Smart Forms stores as one value. |
smart-forms/repeating-group-variable | warning | Reports a variable on or below a repeating group whose value differs between repetitions, of which Smart Forms keeps one. |
smart-forms/named-expression-not-referenceable | error | Reports a reference to a named expression that Smart Forms does not make available to other expressions. |
smart-forms/forward-variable-reference | warning | Reports a variable that references a variable or itemPopulationContext that Smart Forms evaluates after it when it prefills the form. |
smart-forms/unsupported-template-extract-context | error | Reports a templateExtractContext Smart Forms ignores because it is not a valueString. |