Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require that frontmatter exists #28

Open
smartcontracts opened this issue Nov 17, 2023 · 1 comment
Open

Require that frontmatter exists #28

smartcontracts opened this issue Nov 17, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@smartcontracts
Copy link

smartcontracts commented Nov 17, 2023

Hi, I'm using remark-lint-frontmatter-schema to validate the frontmatter for some markdown files. However, it seems that this plugin doesn't warn you when a file is missing frontmatter entirely, which means required fields don't get enforced at all. I believe it's reasonable behavior for an error to be thrown if the frontmatter schema requires a field to exist but the frontmatter isn't present (since the field therefore must not exist). I think a relatively easy way to solve this would be to feed empty frontmatter into validation if the frontmatter doesn't exist.

Would be ideal to get this fixed, even if this behavior is behind a flag or something to avoid breaking existing projects. Thank you!

@JulianCataldo
Copy link
Owner

Mhhh, interesting indeed. I will look into this. Thanks for your feedback!

@JulianCataldo JulianCataldo added bug Something isn't working good first issue Good for newcomers labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants