@salesforcedevs/sfdocs-liquid-lint-frontmatter
v1.0.4
Published
Validate the 'liquid' frontmatter schema and external data file references in sfdocs Markdown.
Maintainers
Keywords
Readme
liquid-lint-frontmatter
Validate the liquid frontmatter schema in sfdocs Markdown files.
What it checks
| Check | Example bad input | Error |
|-------|-------------------|-------|
| liquid must be an object | liquid: 42 | "must be an object" |
| enabled is required | liquid: { data: x.yaml } | "missing required property 'enabled'" |
| enabled must be boolean | liquid: { enabled: "true" } | "must be a boolean" |
| data must be a string | liquid: { enabled: true, data: 42 } | "must be a string" |
| data must not be empty | liquid: { enabled: true, data: " " } | "must not be empty" |
| data must be .yml/.yaml | liquid: { enabled: true, data: d.json } | "must reference a YAML file" |
| data file must exist | liquid: { enabled: true, data: gone.yaml } | "data file not found" |
| data file must parse | liquid: { enabled: true, data: bad.yaml } | "not valid YAML" |
| No unknown properties | liquid: { enabled: true, debug: true } | "Unknown property 'debug'" |
Schema
{
"liquid": {
"type": "object",
"additionalProperties": false,
"required": ["enabled"],
"properties": {
"enabled": { "type": "boolean" },
"data": { "type": "string", "pattern": "\\.(ya?ml)$" }
}
}
}Install
yarn add @salesforcedevs/sfdocs-liquid-lint-frontmatterUsage
Configured in the sfdocs validate lint config as liquid-frontmatter.
