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

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

Closed
Trott opened this issue Jun 15, 2018 · 2 comments
Closed

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

Trott opened this issue Jun 15, 2018 · 2 comments
Labels
🧒 semver/minor This is backwards-compatible change

Comments

@Trott
Copy link
Contributor

Trott commented Jun 15, 2018

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:

  • If only one file changes, it re-lints the entire directory instead of just the file that changed.
  • If our rules change, it's not smart enough to know that it needs to re-lint everything. (ESLint knows that its cache is invalid if the config settings are changed.)
  • If remark-cli itself is updated, the Makefile does not know to re-lint everything. (Again, ESLint knows that its cache is invalid if the cache was generated by a different version of ESLint.)

Your environment

  • macOS 10.13.5
  • remark-cli, remark-preset-lint-node
  • node 10.4.1, npm 6.1.0

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
Copy link
Member

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 👉 unifiedjs/unified-engine#22

@Murderlon
Copy link
Member

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 :)

@ChristianMurphy ChristianMurphy added 🧒 semver/minor This is backwards-compatible change needs pr labels Jul 24, 2018
@Trott Trott closed this as completed Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧒 semver/minor This is backwards-compatible change
Development

No branches or pull requests

3 participants