@salesforcedevs/sfdocs-liquid-lint-include
v1.0.6
Published
Validate '{% include "..." %}' Liquid include paths in sfdocs Markdown.
Maintainers
Keywords
Readme
liquid-lint-include
This Markdown plugin validates {% include "..." %} paths used by the sfdocs
Liquid runtime. It mirrors how liquid-runtime.ts resolves include roots so
the lint reports the same set of accepted paths the SSG/runtime accepts.
What it checks
For each {% include "<path>" %} (whitespace-control variants supported), in a
file with liquid.enabled: true, the rule:
- Rejects absolute paths and URLs (
http://,https://,file://, ...). - Rejects paths that escape every ancestor root (mirrors the
FOLDER_LEVELS_FOR_LIQUID_ROOTS = 8resolution in the runtime). - Verifies the resolved file exists on disk.
- Verifies the include points to a Markdown file (
.md/.markdown). - Skips occurrences inside fenced and inline code (the same protection the runtime applies before parsing).
Why
@salesforcedevs/sfdocs-remark-lint-include-directive covers the :::include
directive form. This rule is the Liquid analogue, for the
{% include "../../shared/snippet.md" %} form added with the Liquid integration.
Install & build
yarn install && yarn buildRelease versioning and commits are automated via Lerna when you merge the release PR.
