Skip to content

perf(core): validate out-of-lint-set cache dependencies by timestamp - #3253

Open
JoshuaKGoldberg wants to merge 4 commits into
mainfrom
perf/cache-dependency-invalidation
Open

perf(core): validate out-of-lint-set cache dependencies by timestamp#3253
JoshuaKGoldberg wants to merge 4 commits into
mainfrom
perf/cache-dependency-invalidation

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

PR Checklist

Overview

For file paths outside the lint set, we now do a touch timestamp check on the file itself using stat. Touch times are cached so it's at most one per file.

Also two small fixes as a part of this:

  • The continue inside the dependency loop continued the inner loop rather than moving to the next file, so markAsUncached could fire repeatedly for one file and the file's own timestamp check still ran after it had already been invalidated. The dependency scan is now a helper that returns a boolean, so the outer loop can continue properly.
  • createDiskBackedLinterHost's getFileTouchTime/getFileTouchTimeSync threw when a file did not exist, even though both are typed as returning number | undefined (the VFS host already returns undefined). They now return undefined, which is what lets a deleted dependency be treated as changed instead of crashing the run.

❤️‍🔥

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5449ead

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
flint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploy Preview for flint-fyi ready!

Name Link
🔨 Latest commit 5449ead
🔍 Latest deploy log https://app.netlify.com/projects/flint-fyi/deploys/6a932b5d9c53a60008ecdeb9
😎 Deploy Preview https://deploy-preview-3253--flint-fyi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as ready for review August 21, 2026 20:10
@JoshuaKGoldberg
JoshuaKGoldberg requested review from lishaduck and michaelfaith and removed request for michaelfaith August 29, 2026 18:55

@michaelfaith michaelfaith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a couple minor nits.

const host = createDiskBackedLinterHost(integrationRoot);
const missingPath = path.join(integrationRoot, "missing.txt");

expect(await host.getFileTouchTime(missingPath)).toEqual(undefined);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://vitest.dev/api/expect.html#tobeundefined

Suggested change
expect(await host.getFileTouchTime(missingPath)).toEqual(undefined);
expect(await host.getFileTouchTime(missingPath)).toBeUndefined();

const host = createDiskBackedLinterHost(integrationRoot);
const missingPath = path.join(integrationRoot, "missing.txt");

expect(host.getFileTouchTimeSync(missingPath)).toEqual(undefined);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(host.getFileTouchTimeSync(missingPath)).toEqual(undefined);
expect(host.getFileTouchTimeSync(missingPath)).toBeUndefined();

@michaelfaith michaelfaith added the ready to merge 2+ team members approved; we're now waiting on the author to file followups and self-merge. label Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge 2+ team members approved; we're now waiting on the author to file followups and self-merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⚡️ Performance: tsconfig.json dependency invalidates every cached file if not linting JSON

2 participants