Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Update for changes in remark, remark-lint #7

Open
wooorm opened this issue Feb 27, 2017 · 0 comments
Open

Update for changes in remark, remark-lint #7

wooorm opened this issue Feb 27, 2017 · 0 comments

Comments

@wooorm
Copy link

wooorm commented Feb 27, 2017

Hi! 👋

remark-lint recently changed (and so did remark). Each rule is now a separate package published to npm, for example, take the final-newline rule, which is now remark-lint-final-newline.

You can find more info on what changed on the release pages for remark and remark-lint, but they may be lacking as I’m working hard on upgrading the ecosystem first.

There’s a package, unified-lint-rule, that you can (should!) depend on to make rules though. remark-lint-strong-marker, also a good example, uses it to accept options.

To use “rules”, you must install all rules you want to use, for example:

npm install --save remark-lint remark-lint-final-newline remark-lint-strong-marker

And then specify them in your config file like so:

// ...
{
  "plugins": [
    "lint",
    "lint-final-newline",
    ["lint-strong-marker", "*"]
  ]
}
// ...

...on the API you can do the following:

var remark = require('remark');
var lint = require('remark-lint');
var finalNewline = require('remark-lint-final-newline');
var strongMarker = require('remark-lint-strong-marker');

remark()
  .use(lint)
  .use(finalNewline)
  .use(strongMarker, '*')
  // ...

Finally, feel free to drop by in Gitter room, or reply below, to ask any questions you may have!

P.S. When done, could you create a PR for remark-lint to include this in the list of external rules?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant