@salesforcedevs/sfdocs-liquid-lint-variables-reference
v1.1.3
Published
Validate that {{ variables.<namespace> }} references in content point to a namespace declared in content-config.yml.
Maintainers
Keywords
Readme
@salesforcedevs/sfdocs-liquid-lint-variables-reference
Lint rule that validates {{ variables.<namespace>... }} references in content against the
namespaces declared in the repository's content-config.yml.
What it checks
Every output reference of the form {{ variables.<namespace>... }} must use a <namespace> that is
declared under the variables block in content-config.yml. A reference to an undeclared namespace is
reported as an error at the reference position.
- References inside fenced code blocks (
```) are ignored (matching runtime behavior). - If the repo has no
variablesblock (or nocontent-config.yml), every{{ variables.* }}reference is flagged. - Validating an individual key within a declared namespace is intentionally out of scope for this
rule (it only checks the namespace). Missing keys are surfaced as non-blocking warnings by
@salesforcedevs/sfdocs-liquid-lint-variables-keys.
Example
# content/en-us/content-config.yml
variables:
platform: variables/platform.yml{{ variables.platform.name }} <!-- ok: platform is declared -->
{{ variables.product.sku }} <!-- error: product is not declared -->Usage
const variablesReference = require('@salesforcedevs/sfdocs-liquid-lint-variables-reference');
remark().use(variablesReference);