Add support for --cache
See original GitHub issueHi! This has been discussed before: #99
However there are 3 problems with that solution:
- Cache is not persisted to disc
- It involves effort on the user, where one would expect just to set up a simple
cache: true
variable - Eslint command line already does it in a well defined
.eslintcache
Thank you!
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Cache.add() - Web APIs - MDN Web Docs
The add() method of the Cache interface takes a URL, retrieves it, and adds the resulting response object to the given cache.
Read more >Caching - web.dev
Cache storage is a powerful tool. It makes your apps less dependent on network conditions. With good use of caches you can make...
Read more >A Guide To Caching in Spring - Baeldung
The getAddress() call will first check the cache addresses before actually invoking the method and then caching the result. While in most cases ......
Read more >Add support for caching GET requests · Issue #31 · axios/axios
Heh, I was just looking into this! I thought that an interceptor could be used or a transformer that'll immediately resolve with a...
Read more >Set up content caching on Mac - Apple Support
Click the Cache pop-up menu, then choose the content you want cached. All Content: Store software updates and apps downloaded from Apple, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While ESLint’s CLI has the responsibility of finding and reading files for linting, gulp-eslint relies on the Gulp stream to manage file sources. If a file should not be linted, it should not be passed to gulp-eslint in the stream.
The cached-lint example demonstrates how caching could be managed for a gulp stream; though, is not intended to be a direct implementation of ESLint’s CLI cache option, nor is it the only way to avoid needless file linting.
Fortunately, it is possible to persist a file/content cache to disc in a gulp stream (see gulp-cache-money or gulp-file-cache). However, I’m not aware a gulp plugin based on file-entry-cache (the cache package used by ESLint). If another file-based cache plugin doesn’t work in its place, perhaps creating a gulp plugin based on file-entry-cache would be useful with gulp-eslint as well as many other gulp plugins.
Though
cache:true
would be an easy option to configure, its simplicity is due to assumptions that must be made about the environment and use case. ESLint’s CLI acts as an independent tool, run directly against the file system. Because of this, a simple--cache
option for a file-based cache is a stable and practical solution. On the other hand, Gulp’s virtual files may come from a range of sources and may be composed of a series of tools/plugins. For a plugin, it is uncertain whether a virtual file’s origin (if there is one) will match it’s destination (if there is one) or how the content may be transformed along the way. However, caching can be considered when composing a gulp task, where the expectations are certain.You can find here a solution how to overcome that issue: https://dzone.com/articles/how-to-improve-performance-of-eslint-in-gulp