remarkjs / remark

markdown processor powered by plugins part of the @unifiedjs collective
https://remark.js.org
MIT License
7.71k stars 357 forks source link

feature request: --cache similar to ESLint for remark-cli? #338

Closed Trott closed 6 years ago

Trott commented 6 years ago

Subject of the issue

It would be useful for Node.js core if remark-cli had a --cache option similar to that used in ESLint. We fake it right now in our Makefile by generating a timestamp file and only linting if the directory of markdown files was modified after the timestamp file. This works OK in most situations but has the following disadvantages:

Your environment

Steps to reproduce

We use something like remark-cli/cli.js -q -f doc where doc is a directory with a lot of markdown files. Ideally, it would be great if we could pass --cache to generate a .remarklintcache file the way ESLint generates an .eslintcache file.

Expected behaviour

With the cache file, running the command again and again should be much faster (unless all the files change, a rule is changed, or the version of remark-cli is updated).

Actual behaviour

Well, the feature isn't implemented so I get the remark-cli help message.

Murderlon commented 6 years ago

I will give this a shot this weekend :) Also, this feature will live in the underlying unified-engine, the already existing issue can be found here 👉 https://github.com/unifiedjs/unified-engine/issues/22

Murderlon commented 6 years ago

Turns out I'm completely packed till I leave for vacation in two weeks so I won't be able to do this for at least a month. To not claim a stale contribution, consider me out until I say here otherwise. So if anyone is excited to pick this up you don't have to hesitate :)