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

QUESTION: Is it possible to write custom linting rules, including Quick Fix information, for frontmatter? #1202

Open
cdeyoung opened this issue May 8, 2024 · 2 comments
Labels

Comments

@cdeyoung
Copy link

cdeyoung commented May 8, 2024

I know I can access frontmatter data using params.frontMatterLines; however, the onError function seems to operate solely on the params.lines array. Is there any way to write custom linting rules to validate text in the frontmatter area of a document?

@DavidAnson
Copy link
Owner

Not directly. Front matter is so varied that I have not thought to support something like this.

But if you want to lint front matter, I suppose you could report errors for line 1 of the Markdown. It would be slightly wrong, but maybe good enough for your purposes.

@cdeyoung
Copy link
Author

cdeyoung commented May 8, 2024

Your decisions makes sense. I think everything is great in markdownlint as it is. The one thing that would make it perfect would be the ability to tell onError which array to operate on so people could write custom linters for their frontmatter, too, since it is only the reporting that doesn't currently work.

I'll try doing what you suggested with line one of the params.lines array.

Thanks for your response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants