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

Update for changes in remark, remark-lint #25

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

Update for changes in remark, remark-lint #25

wooorm opened this issue Feb 27, 2017 · 4 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?

P.P.S. If you want, I can do the updates, if you add me as a collab on this repo and on npm!

@ThomDietrich
Copy link

@wooorm as there was no reaction by the original author are you considering to fork this rule into being one of the official ones? I would really appreciate to use it.

@wooorm
Copy link
Author

wooorm commented Jun 28, 2017

@ThomDietrich Hi! 👋

I don’t feel this should be part of the core of remark-lint: sentence-detection is just too hard a problem.

  1. I made the whole system quite pluggable so it should be relatively simple to create and maintain an external rule, feel free to fork and maintain your own version
  2. Alternatively, check out the retext ecosystem, and in particular remark-retext and retext-sentence-spacing

Does that help?

@ThomDietrich
Copy link

Hey @wooorm 👋

I already thought that this is the issue. I could look into this project but it will probably take me a few minutes. Hoped to benefit from your offer "If you want, I can do the updates" - maybe @why-jay wants to have another look?

I will also look into remark-retext, thanks for the hint!

Thanks for your prompt and informative answer!

@wooorm
Copy link
Author

wooorm commented Jun 30, 2017

I can help convert and maintain a bit, but I’m already owning too many repo’s to take the lead on a fork!

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

No branches or pull requests

2 participants