Skip to content

Add ESLint cache support via new settings#2120

Open
mako-taco wants to merge 2 commits intomicrosoft:mainfrom
mako-taco:feat/eslint-cache-support
Open

Add ESLint cache support via new settings#2120
mako-taco wants to merge 2 commits intomicrosoft:mainfrom
mako-taco:feat/eslint-cache-support

Conversation

@mako-taco
Copy link

@mako-taco mako-taco commented Feb 7, 2026

Fixes #1844

Introduce three new settings — eslint.cache, eslint.cacheLocation, and eslint.cacheStrategy — that enable ESLint's built-in result caching when linting on save. When cache is active the server uses lintFiles (disk read) instead of lintText (in-memory) so the .eslintcache file is consulted and updated, which also benefits command-line ESLint and pre-commit hooks.

Introduce three new settings — `eslint.cache`, `eslint.cacheLocation`, and
`eslint.cacheStrategy` — that enable ESLint's built-in result caching when
linting on save. When cache is active the server uses `lintFiles` (disk read)
instead of `lintText` (in-memory) so the `.eslintcache` file is consulted and
updated, which also benefits command-line ESLint and pre-commit hooks.

Changes across the four touchpoints required by AGENTS.md:
- package.json: setting schemas under contributes.configuration
- $shared/settings.ts: ConfigurationSettings type
- client/src/client.ts: readConfiguration() mapping
- server/src/eslint.ts: option wiring and validate() integration

Also includes targeted refactors for the new code:
- Extract `applyCacheOptions()` helper from `withClass()`
- Extract `shouldUseLintFiles()` type-guard from `validate()`
- Narrow `ESLintClassOptions.cacheStrategy` to `'metadata' | 'content'`
- Add JSDoc to all new public/shared cache properties

Co-authored-by: Cursor <cursoragent@cursor.com>
@mako-taco
Copy link
Author

mako-taco commented Feb 7, 2026

@microsoft-github-policy-service agree

@mako-taco mako-taco marked this pull request as ready for review February 9, 2026 17:44
@mako-taco
Copy link
Author

Need anything else from me, here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cache files (.eslintcache) on save

1 participant