> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Prettier Hooks

Using [pre-commit](https://pre-commit.com/) with Prettier is a good way to provide automated linting to your YAML files. With [pre-commit](https://pre-commit.com/), you also get the benefit of only linting/fixing the files that changed.

This makes the formatting process more efficient and ensures consistent YAML styling across your project without unnecessarily processing unmodified files.

[https://prettier.io/docs/en/precommit.html](https://prettier.io/docs/en/precommit.html)

## `prettier`

<Info>
  **What it does**<br />Automatically formats YAML files according to Prettier's style rules, ensuring consistent formatting across all YAML files in your project.

  **When to use it**<br />Use this hook when you want to maintain consistent YAML formatting across your project.
</Info>

**Arguments**

* `--write`: Write changes directly to files
* `--check`: Check if files are formatted without modifying them
* `--tab-width`: Number of spaces per indentation level
* `--use-tabs`: Use tabs instead of spaces for indentation
* `--prose-wrap`: Control wrapping of prose (preserve, always, never)

**Example**

```yaml theme={"system"}
repos:
  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v3.1.0
    hooks:
      - id: prettier
        types: [yaml]  # Only run on YAML files
        additional_dependencies:
          - prettier@3.1.0
        args: [--write]
```

## Using rules in your .prettierrc file

To point pre-commit to use your custom `.prettierrc` rules file, you need to put the `.prettierrc` file in your repository root.

**See also:**

<Card title="Prettier" icon="arrow-right" horizontal href="/integrations/prettier" />


## Related topics

- [Prettier](/integrations/prettier.md)
- [Lint](/products/code-ide/command-panel/code-quality.md)
- [Paradime Setup and Configuration](/integrations/pre-commit/paradime-setup-and-configuration.md)
- [Enforce SQL and YAML Best Practices](/guides/paradime-101/getting-started-with-the-paradime-ide/utilizing-advanced-developer-features/enforce-sql-and-yaml-best-practices.md)
- [Hooks & Operational Tasks](/guides/dbt-fundamentals/configuring-your-dbt-project/hooks-and-operational-tasks.md)
