Qard / remark-lint-code

Lint fenced code blocks by corresponding language tags
12 stars 1 forks source link

Add example for inside a .remarkrc file #4

Open ndelangen opened 7 years ago

ndelangen commented 7 years ago

Here's what I got to work:

{
  "plugins": [
    "remark-preset-lint-recommended",
    ["remark-lint-list-item-indent", false],
    ["remark-lint-code", {"js": "node_modules/remark-lint-code-eslint"}]
  ]
}

I'm still looking at improving this, so feedback is very much welcome!

I could create a PR adding this documentation if you'd like.

ndelangen commented 7 years ago

I now have this:

{
  "plugins": [
    "remark-preset-lint-recommended",
    ["remark-lint-list-item-indent", false],
    ["remark-lint-code", {"js": {
      "module": "node_modules/remark-lint-code-eslint",
      "options": {
        "fix": true
      }
    }}]
  ]
}

which will use eslint --fix option on the code blocks inside my markdown files.

This is making me pretty happy 👍