X Tutup
Skip to content

fix: match useCheckSum casing expected by file-entry-cache v11#18914

Open
paulofduarte wants to merge 2 commits intoprettier:mainfrom
paulofduarte:fix/cache-strategy-content-checksum-casing
Open

fix: match useCheckSum casing expected by file-entry-cache v11#18914
paulofduarte wants to merge 2 commits intoprettier:mainfrom
paulofduarte:fix/cache-strategy-content-checksum-casing

Conversation

@paulofduarte
Copy link

@paulofduarte paulofduarte commented Mar 2, 2026

Description

Fix --cache-strategy content being silently ignored since the file-entry-cache v10 → v11 upgrade.

file-entry-cache v11 renamed its option from useChecksum (lowercase s) to useCheckSum (capital S). Prettier still passes the old casing, so the option is silently ignored — content hashing never activates and the cache falls back to file-size-only comparison.

Fixes #18913.

Checklist

  • I've added tests to confirm my change works.
  • (If changing the API or CLI) I've documented the changes I've made (in the docs/ directory).
  • (If the change is user-facing) I've added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I've read the contributing guidelines.

`file-entry-cache` v11 expects `useCheckSum` (capital S) in its
options, but Prettier passes `useChecksum` (lowercase s). JavaScript
property access is case-sensitive, so the option is silently ignored.

This causes `--cache-strategy content` to never enable content hashing.
With both `useCheckSum` and `useModifiedTime` effectively false, the
only change detection that runs is an unconditional file-size comparison.
Any edit that preserves the byte count is invisible to the cache.
@netlify
Copy link

netlify bot commented Mar 2, 2026

Deploy Preview for prettier ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d35ba29
🔍 Latest deploy log https://app.netlify.com/projects/prettier/deploys/69a971df049f080008c76625
😎 Deploy Preview https://deploy-preview-18914--prettier.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 4, 2026

Open in StackBlitz

yarn add https://pkg.pr.new/@prettier/plugin-hermes@18914.tgz
yarn add https://pkg.pr.new/@prettier/plugin-oxc@18914.tgz
yarn add https://pkg.pr.new/prettier@18914.tgz

commit: c0ccf68

@fisker
Copy link
Member

fisker commented Mar 4, 2026

Thanks for fixing this.

Please follow the PR template, and fill nessary information instead of AI generate contents.

Is it possible to add a test for it?

@paulofduarte
Copy link
Author

Hi @fisker . I will update the PR tomorrow to follow the template. Will also include a test. The issue linked to the PR has the details to reproduce it. I'll add it as a test. Thanks.

Add integration test verifying that --cache-strategy content detects
file changes even when file size is unchanged. Add changelog entry.
@paulofduarte
Copy link
Author

Hi @fisker, first I would like to thank you for maintaining such an useful project, second for being patient for me not following the CONTRIBUTING.md and still responding an keeping the PR open. I hap updated the PR to follow the template and added a test to cover the bugfix. Please let me know if you need anything else. I am happy to make a tiny contribution to prettier.

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-strategy content silently falls back to size-only comparison (casing mismatch with file-entry-cache v11)

2 participants

X Tutup