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

eslint-plugin-mdx won't work along with eslint-plugin-markdown #259

Closed
chenxsan opened this issue Dec 20, 2020 · 6 comments · Fixed by #283
Closed

eslint-plugin-mdx won't work along with eslint-plugin-markdown #259

chenxsan opened this issue Dec 20, 2020 · 6 comments · Fixed by #283
Labels
external known issue from external, can't do much by ourselves 👀 no/external This makes more sense somewhere else 🦋 type/enhancement This is great to have 🙆 yes/confirmed This is confirmed and ready to be worked on

Comments

@chenxsan
Copy link
Contributor

Subject of the issue

I have eslint-plugin-markdown enabled in this project with processor option enabled:

    {
      files: ['**/*.mdx'],
      processor: 'markdown/markdown',
    },

Now when I enable eslint-plugin-mdx:

    {
      files: ['**/*.mdx'],
      processor: 'markdown/markdown',
      extends: ['plugin:mdx/recommended'],
    },

eslint won't report any errors.

Only when I remove processor will `eslint report the lint problems:

image

Your environment

  • OS:
  • Packages:
  • Env:

Steps to reproduce

  1. clone code from https://github.com/webpack/webpack.js.org/pull/4326
  2. run yarn
  3. run yarn lint:js

Expected behaviour

eslint-plugin-mdx should work fine along with eslint-plugin-markdown.

Actual behaviour

@chenxsan chenxsan added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Dec 20, 2020
@JounQin
Copy link
Member

JounQin commented Dec 21, 2020

They're definitely not same. eslint-plugin-mdx aims to lint .mdx files without inside codes, while eslint-plugin-markdown aims to lint inside codes.

Maybe you need two eslint config to lint .md/.mdx twice if you'd like to lint inside codes.

@chenxsan
Copy link
Contributor Author

Sure they target different things, that's why I expect eslint-plugin-mdx to work fine in my use case.

My point is eslint-plugin-mdx won't work with processor for eslint-plugin-markdown enabled while eslint-plugin-markdown works just fine with or without eslint-plugin-mdx.

And I believe using eslint-plugin-markdown along with eslint-plugin-mdx is a very common use case.

Anyway, I'll see if I can find what's going on under the hood.

@chenxsan
Copy link
Contributor Author

I'm closing this as it's expected as per eslint/markdown#134, i.e., we can't lint those code inside code blocks in .mdx files with eslint-plugin-markdown.

@JounQin One last question, any plan to support linting code inside code blocks now that we can't use it together with eslint-plugin-markdown? It seems to be possible.

@JounQin
Copy link
Member

JounQin commented Dec 21, 2020

The mdx core team is working on v2 and will pasring mdx as estree directly, so such changes are not going to happen soon, but you're free to share ideas about the possible implementation.

@JounQin JounQin added external known issue from external, can't do much by ourselves 👀 no/external This makes more sense somewhere else 🙋 no/question This does not need any changes 🙅 no/wontfix This is not (enough of) an issue for this project and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Dec 21, 2020
@JounQin
Copy link
Member

JounQin commented Mar 2, 2021

I just get an idea that we can already get code blocks by ourselves, so it should be possible to lint them by eslint-plugin-mdx itself.

What means we will never be compatible with eslint-plugin-markdown, but we can support code blocks.

It should not be difficult, I'll get started soon when I'm free.

see #278

@JounQin
Copy link
Member

JounQin commented Mar 13, 2021

reopen in favor of eslint/markdown#178 and #283

@JounQin JounQin reopened this Mar 13, 2021
@JounQin JounQin added 🙆 yes/confirmed This is confirmed and ready to be worked on 🦋 type/enhancement This is great to have and removed 🙋 no/question This does not need any changes 🙅 no/wontfix This is not (enough of) an issue for this project labels Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external known issue from external, can't do much by ourselves 👀 no/external This makes more sense somewhere else 🦋 type/enhancement This is great to have 🙆 yes/confirmed This is confirmed and ready to be worked on
Development

Successfully merging a pull request may close this issue.

2 participants