---
title: "How to Format All Files in a Directory with Prettier | by Dr. ..."
description: "!https://levelup.gitconnected.com/how-to-format-all-files-in-a-directory-with-prettier-5f0ff5f4ffb2"
date: 2023-08-19
published: true
tags:
  - cli
  - prettier
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://levelup.gitconnected.com/how-to-format-all-files-in-a-directory-with-prettier-5f0ff5f4ffb2" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-content">
      <div class="embed-card-title">External Link</div>
      <div class="embed-card-meta">levelup.gitconnected.com</div>
    </div>
  </a>
</div>


Use prettier to format all files in a directory.  By default prettier does not write, it just echos out the format that it would do.  Give it the `--write` and it will write the changes to the files.

``` bash
prettier --write .
```

I just used this on my thoughts repo.

``` bash
prettier --write templates
```
