from Hacker News

Speeding up Prettier locally using the new –cache CLI option

by assadk on 9/10/22, 9:56 PM with 6 comments

  • by hooper on 9/11/22, 4:40 AM

    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.
  • by justusw on 9/11/22, 2:29 AM

    Am I right to assume that Prettier runs single-threaded? I was never able to find an option to parallelize (and I assume it is paralellizable). Being able to speed up Prettier would improve my workflow by a lot.