eslint-mdx
- how to lint/parse Markdown (.md) files with same rules as MDX?
#2229
Replies: 1 comment
-
a) MDX itself only applies the MDX format to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
We use gatsby-plugin-mdx to parse both
.mdx
and.md
.Everything was working great until we moved to MDXv2. Now if there are any un-escaped braces in either
.md
or.mdx
the build breaks. As our site is a technical docs site, many markdown pages had{variable-this}
and{variable-that}
in them. I have been through and updated existing markdown/mdx but we need to stop users adding new braces which are not escaped.So we really need a linter to make sure every brace is escaped before the change is pushed live.
If I have two test files with un-escaped braces, I can get the linter to properly detect the issue in mdx, just not md:
If I do the same with markdown, we get nothing back ie no issues/errors:
This is our eslint config, I've tried to make the markdown (.md) files be treated exactly like mdx but this clearly doesn't work:
Previous discussion with Gatsby team is here
Anybody know how to solve this? Thanks
Beta Was this translation helpful? Give feedback.
All reactions