Change Request: Add `lintText` cache support
See original GitHub issueESLint version
8.5.0
What problem do you want to solve?
IDE linting can be very slow, especially in larger projects. This is because they use eslint.lintText
which, according to the docs, doesn’t use the cache even with cache: true
:
The
eslint.lintText()
method doesn’t use caches even if you pass theoptions.filePath
to the method.
What do you think is the correct solution?
I think (probably read-only) cache support in lintText
would make a lot of sense here, and could greatly improve the IDE performance of ESLint. As long as the existing cache invalidation paths work correctly, it seems like a safe enough idea? But I wasn’t able to find any prior discussions on the topic.
Participation
- I am willing to submit a pull request for this change.
Additional comments
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Add .eslintcache support · Issue #1323 · microsoft/vscode-eslint
Hi, I'm wondering if it's possible for this extension to use the .eslintcache in my workspace root to improve linting performance.
Read more >Node.js API - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Customize your JavaScript client | Algolia
The client caches requests to Algolia and their responses. You can change the location of your caches, or turn off caching completely. You...
Read more >standard-engine | Yarn - Package Manager
standard-engine Tests CI npm downloads javascript style guide. Overview. Wrap your own eslint rules in a easy-to-use command line tool and/or a JS...
Read more >cacheable-request - npm
Wrap native HTTP requests with RFC compliant cache support. ... Adds cache support to any existing HTTP code with minimal changes ...
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
Thanks for the suggestion. I’m guessing there’s a reason we don’t support caching in this case, but it will probably take some digging to figure it out. I’m not opposed to the idea, I’d just want to make sure we know why we aren’t already doing it before we make such a change.
This would end up being a breaking change, though, so we would need to wait for the next major version before releasing it.
Closing due to age.