Validate Markdown frontmatter YAML against an associated JSON schema using remark-lint. Current version: 3.15.4 (released Oct 2023). Released regularly with bug fixes. Key differentiators: supports JSON Schema draft-07, both in-file $schema and global pattern associations, auto-fixes, integration with VS Code and ESLint MDX, and CLI reporting. Uses ajv for validation.
npm install remark-lint-frontmatter-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Set up a remark processor with remark-lint and remark-lint-frontmatter-schema, validate frontmatter against a JSON schema, and see lint messages.
Validate your schema against JSON Schema meta-schema before use.
Update configuration to new format: { schemas: [{ pattern: '*.md', schema: {...} }] }Use `schemas` array with inline schema or `$ref` to external file.
Use relative paths (e.g., `$schema: ./schema.json`) or a URL. For local schemas, ensure the file resolves relative to the working directory.
Ensure that only one YAML frontmatter block exists, or the first one is the intended frontmatter.
Run `npm install remark-lint-frontmatter-schema` and ensure import path is correct.
Use default import: `import plugin from 'remark-lint-frontmatter-schema'`
Add the missing required fields to the frontmatter YAML.
Check the `schemas` array configuration and ensure the pattern matches the file being processed.