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

Ability to customize codeblock tags #82

Closed
privatenumber opened this issue Aug 13, 2017 · 7 comments
Closed

Ability to customize codeblock tags #82

privatenumber opened this issue Aug 13, 2017 · 7 comments

Comments

@privatenumber
Copy link

Currently working with Vue and we'd like to document our examples in markdown with this plugin. However, we have been using:

> ```vue
> ...
> ```

I'd like to be able to customize the tags used for the code block.

@btmills
Copy link
Member

btmills commented Sep 5, 2017

I want to to support this. Unfortunately, processor plugin settings seem to be pretty difficult due to API limitations. There's a workaround in eslint-plugin-html:

https://github.com/BenoitZugmeyer/eslint-plugin-html/blob/f3396817943c52d9c20c5c46e2cfca2d13353c3e/src/index.js#L11-L19

I really don't want to patch Linter.verify, so first I'll see if there's a way to get official support for processor plugin options in ESLint core.

@btmills btmills added the blocked label Sep 5, 2017
@j-f1
Copy link

j-f1 commented Dec 16, 2017

You could add an eslint-plugin-markdown key to package.json:

{
  // ...
  "eslint-plugin-markdown": {
    "languages": [
      "ts",
      "js"
    ]
   }
}

@btmills
Copy link
Member

btmills commented Jan 2, 2019

We just merged an ESLint RFC that will will provide support for this! https://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements Once it's implemented in ESLint, we'll be able to add support into the plugin.

@alexander-akait
Copy link

alexander-akait commented Jun 25, 2019

/cc @btmills eslint@6 was released, any news about this issue?

@h0adp0re
Copy link

Would also like to know about progress on this.

@seedy
Copy link

seedy commented Aug 13, 2019

I have a specific use case for this feature.

I work on a project in which we display code examples in .md files via styleguidist.

The specific logic for this lib is that it ignores ```js static blocks. So I'd like to tell the same to eslint-plugin-markdown

So far, my workaround is to prefix each of these blocks with <!-- eslint-skip -->

@btmills
Copy link
Member

btmills commented Feb 26, 2020

👋 I'm now actively working on implementing the new processor API so that this plugin can extract code blocks of any syntax and pass them to ESLint! I'm tracking progress in #138, so subscribe to that issue if you'd like updates, and I'll close this so that #138 is the primary issue for this work.

@btmills btmills closed this as completed Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants