Re:Speeding up Prettier locally using the new –cache CLI option
by hooper on Sunday September 11, 2022 @12:40AM
(#32796879)
If your files are under version control, you already have a generic change detection mechanism that can give you a shorter list of changed files that need to be checked for formatting. For example, you can run code formatters in pre-commit hooks. Mercurial's "fix" extension rewrites commits using formatting fixes that can be focused on changed line ranges. Of course, the purpose of this --cache feature is still valid for other situations.
[ Parent
| on HN ]
Re:Speeding up Prettier locally using the new –cache CLI option
by bobbylarrybobby on Sunday September 11, 2022 @01:54AM
(#32797178)
In between commits, the `--cache` option is still helpful because it means you can avoid running prettier on a file whose contents have changed since the last commit but not since it was last saved.
That said, formatters should be run in pre commit hooks anyway.