Sitelet https://github.com/prettier/prettier/issues/18016
Skip to content

[cache issue] Prettier does not recheck files which used to be in .prettierignore #18016

Description

@HolgerJeromin

Prettier 3.6.2

I changed hundreds of files in a big feature branch (for es modules so I dropped namespace foo { indention).
To have easier rebase with main branch over month I added these files to .prettierignore.
This worked like a charm.

Now I am ready and I want to readd the files to my prettier workflow.
I deleted all entries in .prettierignore.
But prettier did not checked the "now new" files.

This is probably because they are marked as unchanged in prettier cache.

const command =
  `..\\node_modules\\.bin\\prettier.cmd --ignore-path ../.prettierignore` +
  ` --cache --cache-strategy metadata` +
  ` --cache-location ${solutionDir}/node_modules/.cache/prettier/.prettier-cache` +
  // project items
  ` .`;

Deleting the cache files solved the issue, but this was not obvious.

My suggestion would be to skip adding a file to the cache file which are in .prettierignore.
So when removing the files again, they are rechecked for sure.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliIssues with Prettier's Command Line Interfacelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions