Skip to content

WIP: feat: add experimental virtual code cache for faster type-aware linting#821

Draft
baseballyama wants to merge 1 commit intomainfrom
feat/virtual-file
Draft

WIP: feat: add experimental virtual code cache for faster type-aware linting#821
baseballyama wants to merge 1 commit intomainfrom
feat/virtual-file

Conversation

@baseballyama
Copy link
Member

@baseballyama baseballyama commented Jan 30, 2026

Took benchmark in https://github.com/mcous/eslint-svelte-ts-perf repo.

1. Lint time without this PR

% time pnpm lint:svelte:slow

> eslint-svelte-ts-perf@0.0.1 lint:svelte:slow /Users/baseballyama/git/eslint-svelte-ts-perf
> eslint -c eslint.slow.config.js "src/lib/**/*.svelte"


/Users/baseballyama/git/eslint-svelte-ts-perf/src/lib/component.svelte
  12:3   error  Unexpected console statement  no-console
  19:21  error  Unexpected console statement  no-console

✖ 2 problems (2 errors, 0 warnings)

 ELIFECYCLE  Command failed with exit code 1.
pnpm lint:svelte:slow  20.82s user 1.56s system 101% cpu 22.117 total

2. Lint time with this PR

% time pnpm lint:svelte:slow

> eslint-svelte-ts-perf@0.0.1 lint:svelte:slow /Users/baseballyama/git/eslint-svelte-ts-perf
> eslint -c eslint.slow.config.js "src/lib/**/*.svelte"


/Users/baseballyama/git/eslint-svelte-ts-perf/src/lib/component.svelte
  12:3   error  Unexpected console statement  no-console
  19:21  error  Unexpected console statement  no-console

✖ 2 problems (2 errors, 0 warnings)

 ELIFECYCLE  Command failed with exit code 1.
pnpm lint:svelte:slow  7.40s user 2.02s system 75% cpu 12.548 total

3. Lint time with this PR and cache

% time pnpm lint:svelte:slow

> eslint-svelte-ts-perf@0.0.1 lint:svelte:slow /Users/baseballyama/git/eslint-svelte-ts-perf
> eslint -c eslint.slow.config.js "src/lib/**/*.svelte"


/Users/baseballyama/git/eslint-svelte-ts-perf/src/lib/component.svelte
  12:3   error  Unexpected console statement  no-console
  19:21  error  Unexpected console statement  no-console

✖ 2 problems (2 errors, 0 warnings)

 ELIFECYCLE  Command failed with exit code 1.
pnpm lint:svelte:slow  4.19s user 1.03s system 121% cpu 4.306 total

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

⚠️ No Changeset found

Latest commit: c385c7b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

Try the Instant Preview in Online Playground

ESLint Online Playground

Install the Instant Preview to Your Local

npm i https://pkg.pr.new/svelte-eslint-parser@c385c7b

Published Instant Preview Packages:

View Commit

@coveralls
Copy link

coveralls commented Jan 30, 2026

Pull Request Test Coverage Report for Build 21560162352

Details

  • 1275 of 1696 (75.18%) changed or added relevant lines in 15 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-2.5%) to 92.211%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/virtual-code/dts-generator.ts 22 25 88.0%
src/virtual-code/project-root.ts 42 45 93.33%
src/virtual-code/tsconfig-generator.ts 114 118 96.61%
src/virtual-code/file-scanner.ts 70 75 93.33%
src/parser/index.ts 10 17 58.82%
src/virtual-code/tsconfig-reader.ts 73 85 85.88%
src/virtual-code/hash.ts 117 141 82.98%
src/parser/typescript/index.ts 10 56 17.86%
src/virtual-code/import-rewriter.ts 281 328 85.67%
src/parser/virtual-code-initializer.ts 30 124 24.19%
Totals Coverage Status
Change from base Build 21375485649: -2.5%
Covered Lines: 11957
Relevant Lines: 12851

💛 - Coveralls

@baseballyama baseballyama force-pushed the feat/virtual-file branch 22 times, most recently from df8674c to adb84f1 Compare February 1, 2026 05:49
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.

2 participants