Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change Request: Add `lintText` cache support

See original GitHub issue

ESLint version


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 the options.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.


  • I am willing to submit a pull request for this change.

Additional comments

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

nzakascommented, Dec 30, 2021

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.

nzakascommented, Mar 15, 2022

Closing due to age.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found