Skip to content

--only-changed need review again #6577

@alexander-akait

Description

@alexander-akait

PR: #5910

I think we should remove revert this PR and finish the PR late, as this could potentially create problems:

  1. Argument name - eslint/stylelint (maybe other linters) use --cache option, so currently name is not too good
  2. We should allow to setup cache directory, it can be potential problem for running prettier on difference system and CI
  3. This options should be implement on API side, not on CLI (like eslint/stylelint do), it is allow to use cache for node API users (plugins for IDE, custom CLI runner, etc)
  4. It should be work with --check argument too. I don't want to recheck files what are not changed
  5. More tests, i find we don't have enough tests (i find couple edge cases with cache invalidation).
  6. Use https://github.com/royriojas/file-entry-cache (there are a lot of abilities, fixes and other features, also easy maintenance)
  7. Future implementation --cache (check and format only changed files, as in eslint and stylelint) can be difficult and added an additional cache layer what can be misleading and consume a lot of disk space

It is very important because changing CLI argumentx and logic potentially can be breaking change and we need to do good design for CLI/API to avoid unnecessary/painful problems in future and avoid unnecessary breaking change.

I can to refactor and improve it, but it is require time, and we already prepare 1.19 so better solution is revert this commit for 1.19 and release in 1.20.

/cc @prettier/core @g-harel @duailibe

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.status:needs discussionIssues needing discussion and a decision to be made before action can be taken

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions