How to apply YAML linting rules to Markdown front matter? #744
Unanswered
BenjaminOddou
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I would like to apply the same YAML formatting rules to the front matter in my Markdown (
.md
) files as I do for my standalone YAML (.yml
) files.For example, in a
.yml
file, the linter flags an indentation of 4 spaces and corrects it to 2:Incorrect code (
.yml
):This correctly triggers the linting error:
Expected indentation of 2 spaces but found 4 spaces. eslint(yaml/indent)
.Corrected code (
.yml
):However, these rules are not being applied to the YAML front matter block within my
.md
files. The linter ignores the indentation issue in the following example:some_file.md
Is there a way to configure ESLint to parse and format the YAML front matter inside Markdown files using the same rules defined for
.yml
files?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions